简体   繁体   中英

FindResource() doesn't work

I've got and exe file as resource in my programm. In some occasions I need to extract that programm from resources and put it on harddrive. So I've added a resource to my project:

IDR_EXE1                EXE                     "res\\output.exe"

And then i want to extract it, but it fails on the very first step on this function:

HRSRC hRes = FindResource(NULL, MAKEINTRESOURCE(IDR_EXE1), MAKEINTRESOURCE(IDR_EXE1));

It returns error 1813 - resource can't be found. I'ts strange, because accordingly to MSDN all parametrs are right. Can someone explaing what is wrong here, cause it's a simple task but i can't complete it for a while. Thank you!

为了工作,我手动指定了资源类型:

HRSRC hRes = FindResource(NULL, MAKEINTRESOURCE(IDR_EXE1), L"EXE");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM