Archived

This topic is now archived and is closed to further replies.

Gyannea

2nd Dialog box wont appear

Recommended Posts

I am working with visual C++ 6.0 and have just added a 2nd dialog box to my program. However, when calling CreateDialogParam() the return handle is NULL (error) and the GetLastError() returns 1812 which is "1812 The specified image file did not contain a resource section. ERROR_RESOURCE_DATA_NOT_FOUND " However, the resource is in my list, the dialog ID is in the ''resource.h'' file, and the debugger shows it has the right ID. (I use the MAKEINTRESORUCE() macro). The same routine works with the first dialog box, just not the second. I beleive I am doing something wrong with Visual C++ and not in the coding. Does any one understand what error 1812 really means? Thanks, Brian Brian Reinhold

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
uhmm, it''s kind of hard to say without any code to look at or knowing what the full situation is.

but that error will show up when an incorrect instance handle is used in the CreateDialogParam call. like maybe when using the exe''s handle when the resources are stored in a dll, or visa versa.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
looking into MSDN, the description for 1812 is "The specified image file did not contain a resource section." which means you''re using an instance handle for a module that exists but does not have any resources in it. so either you''re pointing to the wrong exe or dll or you don''t have a resource compilation step in your project build or the resources are not getting properly compiled and linked into the module they belong to.

Share this post


Link to post
Share on other sites
It turned out that the ''instance'' value was wrong; you know, that value which is passed into Winmain(). The handle was okay and the resource was okay. I went chasing down my resource setups and RC files and was barking up the wrong tree all along.

I am not really sure what that parameter means or does, but it is everywhere!

Brian

Share this post


Link to post
Share on other sites