c++ - FindResource() function fails although resource exists -
i trying use win32 findresource() function load embedded resource buffer. adding resource compile time, in visual studio 2015 ide:
as can see using pe editor cffexplorer or reshacker, resource gets added correctly:
the problem comes when try use findresource() function load on runtime, @ start of dll project:
int winapi dllmain( hinstance hinstdll, dword dwreason, lpvoid lpreserved ) { hrsrc reslocation = 0; switch( dwreason ) { case dll_process_attach: // show debug console allocconsole(); freopen("conout$", "w", stdout); //locate our resource reslocation = findresource(hinstdll, "resfile", "resfile"); // findresource returns null error 1813: error_resource_type_not_found printf("test result: reslocation: %i error %i\n", reslocation, getlasterror()); startproc(); break; case dll_process_detach: break; case dll_thread_attach: break; case dll_thread_detach: break; } return 1; }
findresource returns null error 1813: error_resource_type_not_found. idea on why doesn't manage load resource? thank you
the findresource()/loadresource() afaik not find/load entire resource "file" (in fact there no such file, resources embedded in dll), specific resource (string, bitmap, icon etc. specified resource src file).
"resfile" none of allowed resource types, list see resourcetypes.
Comments
Post a Comment