Advertisement

Creating a window from a DLL

Started by March 22, 2003 01:21 PM
5 comments, last by AikonIV 21 years, 7 months ago
I am trying to create a simple window class, and put it in a DLL with a few other of my commonly used classes. The problem is, CreateWindow isn''t working! I''m guessing that the problem has to do with the window being created being used in a different module. Anyone know anything about this?
you need to provide more information
Advertisement
You have to call CreateWindow and RegisterClass in the same module, if that helps.
who told you that?

if you use MCI, window class is registered in msvfw32.dll while any clients, be that other dll modules or the executable, can create MCI windows.

[edited by - niyaw on March 23, 2003 1:47:50 AM]
OK, I think I''ve found the real problem. I believe there''s a little bug somewhere in the message handler system causing it to not return TRUE to WM_NCCREATE causing CreateWindow to fail. I will continue to experiment on this and hopefully get it to work.
I found the problem. It turns out that when I was typing in the message handler, I accidentally was passing the WPARAM and LPARAM in the wrong order, causing DefWindowProc to return FALSE when it received WM_NCCREATE, causing the window creation to fail.
Advertisement
Well, that''ll do it

This topic is closed to new replies.

Advertisement