阅读:986回复:5
请各位网友赶快帮帮我,我都快急死了!!1
我现在想在程序中获得该程序的完整路径,不知道该如何做,哪位在虾能告诉我真是感激不尽,十万火急!!!非常感谢!!!完事之后一定给分!!!
[编辑 - 6/16/02 by wwx79] |
|
|
沙发#
发布于:2002-07-13 12:55
GetCurrentDirectory()不知行不行
答的好请给点分 |
|
|
板凳#
发布于:2002-07-13 15:54
GetModuleFileName
|
|
地板#
发布于:2002-07-13 15:54
GetModuleFileName (AfxGetInstanceHandle(), szAppPath, _MAX_PATH);
|
|
地下室#
发布于:2002-07-15 10:14
在SDK的帮助里面有啊!可以用GetStartupInfo(),或者是
GetModuleFileNameEx The GetModuleFileNameEx function retrieves the fully qualified path for the specified module. DWORD GetModuleFileNameEx( HANDLE hProcess, // handle to the process HMODULE hModule, // handle to the module LPTSTR lpFilename, // buffer that receives the path DWORD nSize // maximum number of characters to retrieve ); Parameters hProcess Handle to the process that contains the module. hModule Handle to the module. lpFilename Pointer to the buffer that receives the fully qualified path to the module. If the filename is longer than maximum number of characters specified by the nSize parameter, the filename is truncated. nSize Specifies the maximum number of characters to copy to the lpFilename buffer. Return Value If the function succeeds, the return value specifies the length of the string copied to the buffer. If the function fails, the return value is zero. To get extended error information, call GetLastError. Requirements Windows NT/2000: Requires Windows NT 4.0 or later. Windows 95/98: Unsupported. Windows CE: Unsupported. Header: Declared in psapi.h. Import Library: Use psapi.lib. Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000. |
|
5楼#
发布于:2004-05-28 10:11
你想问的不是楼上各位说的吧!看看这个
http://www.driverdevelop.com/forum/viewthread.php?tid=56561 |
|
|