- 注册时间
- 2011-3-6
- 最后登录
- 1970-1-1
该用户从未签到
|
代码如下:
CHAR szPathOfComDll[MAX_PATH] = {0};
CStringA sPathOfDecode = "dllLpDecode.dll";
DWORD ret = GetModuleFileNameA(_AtlBaseModule.m_hInst, szPathOfComDll, MAX_PATH);
if (ret != 0) {
CStringA s = szPathOfComDll;
int iPos = s.ReverseFind('\\');
sPathOfDecode = s.Left(iPos + 1) + sPathOfDecode;
}
如果GetModuleFileNameA函数的第一个参数填写NULL,一般找到的是EXE进程的路径。 |
|