   Failed with error 126 when calling CreateWindowEx():  The specified module (Solved)
  If anyone could help me with this problem I would greatly appreciate it.*source removed*[Edited by - Braden on June 19, 2006 11:57:14 AM]
  Change your hInstance in your create to GetModuleHandle(), it can't be null, iirc.   ;  GetModuleHandle( ? )  It takes one parameter.  If I do:  GetModuleHandle(NULL) I get error 6 from GetLastError() when I call CreateWindowEx(), "The handle is invalid."   ;  HINSTANCE Instance = GetModuleHandle(NULL);Works for me.   ;Quote:Original post by Mike2343HINSTANCE Instance = GetModuleHandle(NULL);Works for me.Thats what I'm saying.  It works for me also.  Its just my won't execute CreateWindowEx() without that error.   ;  In Windows 2000 and XP, hInstance is ignored, so it can be null.  If it is Win 98/SE/ME, it can't be.[edit]MSDN -> CreateWindowExQuote:hInstance[in] Windows 95/98/Me: Handle to the instance of the module to be associated with the window.Windows NT/2000/XP: This value is ignored.Sorry if this quote doesn't show up in that link, I got it off the installed version on my pc, which is the latest version.   ;  Yea, Ive tried NULL as well.Your from Indy?  Thats just down the road...   ;  I figured out what the problem is.  The problem was that my WndProc didn't process the messages correctly leading the CreateWindowEx() to fail.Thank you everyone who posted! :)   ;  Originally from Westfield, work in Carmel, live on Edge of Carmel and Indianapolis   ;  From Muncie here.   