#include
"stdafx.h"
#include <stdlib.h>
//得到当前运行进程的完整路径
int _tmain( int argc, _TCHAR* argv[])
{
TCHAR BUFFER[MAX_PATH];
LPWSTR lpFileName = (LPWSTR)BUFFER;
DWORD Len = 0;
if (Len = GetModuleFileName(NULL,lpFileName,MAX_PATH))
{
_tprintf(TEXT( "%s"),BUFFER);
} else{
_tprintf(TEXT( "Error GetModuleFileName"));
}
return 0;
}
#include <stdlib.h>
//得到当前运行进程的完整路径
int _tmain( int argc, _TCHAR* argv[])
{
TCHAR BUFFER[MAX_PATH];
LPWSTR lpFileName = (LPWSTR)BUFFER;
DWORD Len = 0;
if (Len = GetModuleFileName(NULL,lpFileName,MAX_PATH))
{
_tprintf(TEXT( "%s"),BUFFER);
} else{
_tprintf(TEXT( "Error GetModuleFileName"));
}
return 0;
}
转载于:https://blog.51cto.com/driverbox/260533