there's probably an api call for this but i dont know it. i need to get the directoy location of where my app is executed from.
Posted on 2002-01-18 11:01:23 by smurf
You can either use "GetCurrentDirectory" or "GetModuleFileName" (and parse the returned string afterwards).

If you need an example, just tell me, and I put a quick one together!
Posted on 2002-01-18 11:05:28 by bazik
m32lib from version 7 of the masm package has a function called GetAppPath which does exactly what you want.

Thomas
Posted on 2002-01-18 11:07:50 by Thomas
The current directory may sometimes be different from the app directory... so, in that case, GetCurrentDirectory won't always do what is *expected*.

The only secure way I know is to call GetModuleFileName (well, maybe with GetCommandLine too... but we don't need the command line params there).
It does returns the path and the exe name (with extension)... you just have to put a NULL character after the last '\' of the string (the way m32lib's GetAppPath works).

Have a nice week-end !
Posted on 2002-01-18 11:16:27 by JCP
thanks guys! that info came in very handy.:alright:
Posted on 2002-01-18 12:14:21 by smurf