How to set the application path to the running program?

Posted by Y_Y on Stack Overflow See other posts from Stack Overflow or by Y_Y
Published on 2010-06-01T02:47:19Z Indexed on 2010/06/01 2:53 UTC
Read the original article Hit count: 210

Filed under:
|

Hello,

I have a program that is executed by another program. The program that is being executed needs files located at its own location [same folder]. If I call myfile.open("xpo.dll") I might get an error because I am not passing the [fullpath + name + extension]. The program that is being executed can vary paths depending on the installation path. Therefore, I was wondering if there is a way to get the application path [where the application is located] and set it so that when another program executes from another path everything might work properly...?

[Using C++ without .NET Framework]

Thanks.

© Stack Overflow or respective owner

Related posts about c++

Related posts about path