News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

CreateWindowEx Error

Started by pro3carp3, October 14, 2005, 01:15:40 PM

Previous topic - Next topic

pro3carp3

I don't have the code available at the moment, but does anyone know why I might be getting an ERROR_FILE_NOT_FOUND error upon returning from CreateWindowEx?  I have a generic window class, and the window appears on the screen.
LGC

P1

Post some code please. 

I personally don't have a remote debugging connection to your PC, yet.   :green2

Regards,  P1  :8)

rea

Sometimes, hapend when something is wrong in the WndProc, do a simple proc that call the default window proc and return, for see if this help, if that cause that you can register, create and display the simple app, then there is a error somewhere in your WndProc.

MusicalMike

Since CreateWindow and CreateWindowEx return a window handle, it should be noted that ERROR_FILE_NOT_FOUND is not a valid HWND (Window Handel) value. First see what happens when you use a regular old fassion CreateWindow api call. I would also ask you to to check to see weather the hwnd is valid however if the window is being displayed, its obviously a non issue. One thing I might check is, are you innitializing all values of the WNDCLASS or WNDCLASSEX data structure you created? Again, it would help if I had some code to look at.

gabor

Hi!


If the window appears on the screen this means that the creation was succesful. You should not receive an error!
That's why it is important to know, does CreateWindowEx return NULL at all??

Example:


    invoke CreateWindowEx,bla.bla.bla...
    or eax,eax   ; return value
    jnz CreateOk
        PrintError ; print error text via debug macro
CreateOk:
    mov hWnd,eax


I ask this because in several cases the LastError contains an invalid text. Only when the last operation succeded.


Greets, Gábor


pro3carp3

I have a confession to make...

It was actually RegisterWindowEx that was returning the error (as seen in Ollydbg).  I stepped through I Iczelion's tutorial 2 code with Ollydbg and it comes up with the same error.  It appears that Olly is interpreting the return value as an error.  CreateWindowEx appears to be working properly.  My apologies for the confusion.  I had been having problems with loading bitmaps into a brush and thought the error might have been related.  As it turns out, it was a corrupted resource file.

Thanks for the input.
LGC

tenkey

RegisterWindowEx returns an ATOM, not an error value.
A programming language is low level when its programs require attention to the irrelevant.
Alan Perlis, Epigram #8