Results 1 to 3 of 3

Thread: CreateWindowEx inside a DLL

  1. #1

    CreateWindowEx inside a DLL

    Hi All

    I'm trying to create a window using CreateWindowEx inside a DLL
    but for no apparent reason the h_Instance := GetModuleHandle(nil);
    seems to succeed, but then gives me an error code when I call GetLastError();

    For the first time in my life google was absolutely useless :cry:

    I have created a test application to show the error.

    testdll.zip

    Any Help would be greatly appreciated. :lol:

    Use TestExe.exe as the testbed for the Dll while debugging
    I'm out of my mind but please leave a message
    <br />www.sulaco.co.za
    <br />Rage 3D game engine

  2. #2

    CreateWindowEx inside a DLL

    From a quick test, it seems that GetLastError reports an error even before GetModuleHandle, and CreateWindowEx seems to work with widows classes like Static, looks like it has a problem with youre custom window class

  3. #3

    CreateWindowEx inside a DLL

    Ok took another look and the problem narrowed down to WndProc, when instead of you're WindProc DefWindowProc is used it works

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •