News:

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

CreateWindowEx fails with ERROR_SUCCESS

Started by Zaerion, January 06, 2011, 08:04:18 PM

Previous topic - Next topic

dedndave

Quote from: jj2007 on January 06, 2011, 11:28:15 PM
...if you always return zero via xor eax, eax, then Windows believes that all messages are failing...

wait a minute - now i am confused - lol - again

i thought return eax=0 means different things for different messages
most of the ones we process return 0 (we, meaning n00bs, at least),
meaning "success", or more appropriately, "task completed successfully"

donkey

Hi Dave,

You're right. The statement is not entirely correct, different messages have different return values to indicate success, that's the reason I asked to see his WM_CREATE handler, it along with a couple of other messages returning incorrectly is the only way his problem could have occurred (experience pays sometimes). I've seen a lot of problem code over the years that is really nothing more than a failure to make sure that return values are correct, a critical aspect of any callback function is to make absolutely sure you return what the caller is expecting. The golden rule of RTFM applies here.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

dedndave

ok, now i feel better, Edgar - lol

yes - his WinMain looked very "vanilla flavoured", with a couple little exceptions
as for the AppName, i thought it was only optional if the class did not have a title bar
at least, that was my interpretation of the wording on msdn (WNDCLASSEX)
i guess i had just gotten used to the idea of putting a string there

jj2007

Dave & Edgar,
"all messages are failing" was very sloppy. As the Win32.hlp quote says, "it depends on the message".