第四章的线程部分记录

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

转载于:https://my.oschina.net/u/169565/blog/3080048

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值