Finding application Path

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rob T

    #1

    Finding application Path

    I want to write a file into the directory my application is installed into.
    If I just write the file without a path, it will go to the user's working
    directory (ie, where he opened a file from). How can I get the path that the
    application is installed into? I thought there was a way to get the full
    path of the application, but I could not find a way.

    Thanks,
    Rob


  • Rob T

    #2
    Re: Finding application Path

    Thanks, that was what I was looking for.

    Rob
    "lallous" <lallous@lgwm.o rg> wrote in message
    news:eRo5fuRUDH A.612@TK2MSFTNG P12.phx.gbl...[color=blue]
    > Hello,
    >
    > You can get where your application is running from, which is %99 where the
    > application is installed.
    >
    > Use GetModuleFileNa me(NULL, szCurAppPath, MAX_PATH)
    > Then parse the exe path to return only its directory. Usually this is done
    > by truncating the string at the first reverse occurence of the '\'
    > character.
    >
    > Regards,
    > Elias
    >
    >[/color]


    Comment

    Working...