VS2017 win10环境git
_tprintf 一直找不到使用 #include <tchar.h> 便可。windows
C1010 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "pch.h"”? Cheapter4Thread \cheapter4thread\cheapter4thread.cpp 28
解决: 右键你的工做——>属性——>配置属性——>C/C++——>预编译头——>预编译头右边选择不使用预编译头code
`blog
#include "windows.h" #include <tchar.h>get
void DumpModule() { const IMAGE_DOS_HEADER __ImageBase; HMODULE hModule = GetModuleHandle(NULL); _tprintf(TEXT("with GetModuleHandle(NULL) = 0x%x\r\n"),hModule);it
_tprintf(TEXT("with _ImageBase = 0x%x \r\n"), (HINSTANCE)&__ImageBase); hModule = NULL; GetModuleHandleEx( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (PCTSTR)DumpModule, &hModule ); _tprintf(TEXT("with GetModuleHandleEx = 0x%x\r\n"),hModule);
}编译
int main(int argc, TCHAR * argv[]) {thread
DumpModule(); return 0;
} `配置