Results 1 to 3 of 3
  1. #1
    mavi2k's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Posts
    10
    Reputation
    10
    Thanks
    0

    GetPrivateProfileInt full path problem

    Ohai.

    So, i wanted to read an initialization file key value, but it wants a full path name to it. The GetFullPathName function returns a path like this:
    "C:\bla\bla2\hurr\durr\test.ini".
    The GetPrivateProfileInt lpFileName only accepts paths like:
    "C:\\bla\\bla2\\hurr\\durr\\test.ini" or
    "C:\\bla/bla2/hurr/durr/test.ini".

    I do NOT want to put it under the windir (if the parameter does not contain a full path to the file, it search for it under windows directory).

    GetPrivateProfileInt:
    Code:
    int INI = GetPrivateProfileInt( "app", "key", 0, "C:\\INI_TEST\\F1\\F2\\test.ini" );
    test.ini file:
    Code:
    [app]
    key=1
    So are anyone able to help with this little problem?

    Thanks.

  2. #2
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    It returns it as "C:\\bla\\bla2\\hurr\\durr\\test.ini" but when you print it with cout or printf it'll only print one \ because of the escape sequences
    Ah we-a blaze the fyah, make it bun dem!

  3. The Following User Says Thank You to Hell_Demon For This Useful Post:

    mavi2k (03-05-2011)

  4. #3
    mavi2k's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Posts
    10
    Reputation
    10
    Thanks
    0
    Nevermind this btw, i noticed that it returned wrong path to my release folder, every other folder work...
    Really strange.
    Ty for your answer Demon anyways.

    Nevermind this btw, i noticed that it returned wrong path to my release folder, every other folder work...
    Really strange.
    Ty for your answer Demon anyways.

    Nevermind this btw, i noticed that it returned wrong path to my release folder, every other folder work...
    Really strange.
    Ty for your answer Demon anyways.
    Image:


    Nevermind this btw, i noticed that it returned wrong path to my release folder, every other folder work...
    Really strange.
    Ty for your answer Demon anyways.
    Image:
    Last edited by mavi2k; 03-05-2011 at 03:58 AM.