VS2017 win10环境
_tprintf 一直找不到使用 #include <tchar.h> 即可。
C1010 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "pch.h"”? Cheapter4Thread \cheapter4thread\cheapter4thread.cpp 28
解决: 右键你的工作——>属性——>配置属性——>C/C++——>预编译头——>预编译头右边选择不使用预编译头
`
#include "windows.h" #include <tchar.h>
void DumpModule() { const IMAGE_DOS_HEADER __ImageBase; HMODULE hModule = GetModuleHandle(NULL); _tprintf(TEXT("with GetModuleHandle(NULL) = 0x%x\r\n"),hModule);
_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[]) {
DumpModule();
return 0;
} `
gitee:https://gitee.com/penggebest/windowcoresdk