Hi friends. Would someone tell me how a program intalled in a subdirectory, can it know the path (eg: c:\dir1\dir2\myfile.exe)to its own place. In this example when my file myfile.exe is executed it must to know its complete path.
Hi JR, Use API GetCurrentDirectory. best regards, czDrillard
GetCurrentDirectory won't do. In most cases, it seems to give you the correct folder. But it is not the correct way to obtain the current path of the program: 1) SetCurrentDirectory can change the current directory easily 2) If the user creates a shortcut for your prog and specifies a new working directory, GetCurrentDirectory will return the working directory, not the program path. The correct way (in my opinion) is to call GetModuleFileName and parse the path from the full pathname.
Hi JR, To know the complete path of a prog when it is executed, I use GetAppPath, ADDR buffer : buffer receive the complete path of the prog, but not the filename. Vom-bonjour:-() This message was edited by Vom-bonjour:-(), on 2/10/2001 9:36:05 AM