CreateDialogParam in a static linked library fails returning error no 1406

Hi ,

I have a static linked library (pure win32 API calls used) in which I load a
dialog from a template using CreateDialogParam. If the test application & 
the library are within the same solution , the dialog is shown. But , when I
try to load it in a different application( I've included the .lib name in
the project settings & the .h file of the interface) , on click of a button
in the application, it is failing. I tried debugging & it is failing in the
CreateDialogParam, where it is returning NULL & GetLastError returned error
no 1406 "Cannot create a top-level child window".

Can anyone help ?

Thanks,
Aparna
kallakuriAsked:
Who is Participating?
 
cookreCommented:
My guess is that the call to CreateWindowEx() from within CreateDialogParam() is failing because of a duplicate ClassName.
0
 
kallakuriAuthor Commented:
I cannot change to use anything instead of CreateDialogParam. Can you pls suggest any alternative. The dialog sent to the CreateDialogParam is the dialog template from the resource.rc file. Will changing the properties of the dialog help?

Thanks,
Aparna
0
 
kallakuriAuthor Commented:
While debugging I noticed that the macro MAKEINTRESOURCE is returning a bad pointer
0
 
kallakuriAuthor Commented:
I found a link within this site that gave me a link to MSDN answering the linking error.

Since the .lib file is a static linked....it gives the  error. Please read http://support.microsoft.com/default.aspx?scid=kb;en-us;815773#toc for more info
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.