Win32 DLL Resource not found Error
-
Hi every one, I develpoing a MFC application which uses a Win32 dll. This Win32 dll contains a DIALOG Box resource. I wanted to show this dialog by calling an exported function from this dll. But when calling this dialog through DialogboxParam API it returns with error 1812( RESOURCE NOT FOUND). I am solved this problem in MFC by calling AFX_MANAGE_STATE(AfxGetStaticModuleState( )). How to do this in Win32 way. thanks Nitheesh
Jose Jo Martin http://www.simpletools.co.in
-
Hi every one, I develpoing a MFC application which uses a Win32 dll. This Win32 dll contains a DIALOG Box resource. I wanted to show this dialog by calling an exported function from this dll. But when calling this dialog through DialogboxParam API it returns with error 1812( RESOURCE NOT FOUND). I am solved this problem in MFC by calling AFX_MANAGE_STATE(AfxGetStaticModuleState( )). How to do this in Win32 way. thanks Nitheesh
Jose Jo Martin http://www.simpletools.co.in
For pure Win32... The
DialogBox
function has a first parameter ofhInstance
, which is the HINSTANCE of the DLL where you get the resource from. If you loaded the DLL using LoadLibrary, then you already have that parameter. If not, then when the DllMain function of the DLL is called at load time, then the HINSTANCE is passed then. Just remember it! (ie, in a extern variable that all the CPP files in the DLL have access to. That's how I did it in the old days! Iain.
I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]
-
For pure Win32... The
DialogBox
function has a first parameter ofhInstance
, which is the HINSTANCE of the DLL where you get the resource from. If you loaded the DLL using LoadLibrary, then you already have that parameter. If not, then when the DllMain function of the DLL is called at load time, then the HINSTANCE is passed then. Just remember it! (ie, in a extern variable that all the CPP files in the DLL have access to. That's how I did it in the old days! Iain.
I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]
Hi Iain, I am loading the dll using LoadLibrary from a MFC application. And i am using a global HINSTANCE value from DllMain.But still this cause problem. Is this cause the resource handle of the dll be changed? thanks Nitheesh
Jose Jo Martin http://www.simpletools.co.in
-
Hi Iain, I am loading the dll using LoadLibrary from a MFC application. And i am using a global HINSTANCE value from DllMain.But still this cause problem. Is this cause the resource handle of the dll be changed? thanks Nitheesh
Jose Jo Martin http://www.simpletools.co.in
Erm, your first email said you were succeeding with MFC. I told you how to do things in pure Win32. Now you say you still have problems. These facts do not fit each other. Please expand on what you are doing, so I can help better, Iain.
I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]
-
Hi Iain, I am loading the dll using LoadLibrary from a MFC application. And i am using a global HINSTANCE value from DllMain.But still this cause problem. Is this cause the resource handle of the dll be changed? thanks Nitheesh
Jose Jo Martin http://www.simpletools.co.in
Hi, Try passing AfxGetResourceHandle[^] as the first parameter to the DialogBoxParam Function[^]. P.S. Your signature says your name is: Jose Jo Martin and your username says your name is Nitheesh George. Are you suffering from an identity crisis? Best Wishes, -Randor (King of Eternia) and (David Delaune)