News:

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

RegisterClassEx failure

Started by Don57, October 31, 2011, 06:58:55 PM

Previous topic - Next topic

dedndave

that means the class is registering - that is the class global atom

where are you getting the error ? - we need to see more code   :P

dedndave

you might, temporarily, stick some constants in for window x, y, width, height - to see if that's the problem

Don57

I live in the country, that means no internet. I'm only on once or twice a week, and I've go to go.

The error is occuring on the RegisterClassEx calll.

We'll have to pick this up maybe wednesday but more than likely next week.

Thanks everybody for your help. Ill log on next week hopefully I have it if not try this again.

THANKS

baltoro

RegisterClassEx is one of those functions that almost never fails (DAVE knows this).
Even if the Window class is already registered, you'll get an error code telling you that.
Here is: A Simple Tutorial for a Window Program (in C++)
Baltoro

ToutEnMasm

Don't seem very clear.
I suggest to put wc.style to null and made further tests with other styles.
For example CS_BYTEALIGNCLIENT or CS_BYTEALIGNWINDOW
Can be also a problem with the name of the class
You can also put the code who center the window in comment (if it is that who made a change)
If the defaut disappear,verify there is no exception generated by the calcul.

dedndave

there is some kind of misunderstanding, here

if RegisterClassEx returns a non-zero value in EAX, then it is not failing

jj2007

Quote from: baltoro on November 02, 2011, 05:26:04 PM
Here is: A Simple Tutorial for a Window Program (in C++)

Very well written indeed! The ShowWindow/UpdateWindow sequence is not needed if you specify WS_VISIBLE in CreateWindowEx, though.

Don57

Went home and worked on it for a few more hours. I feel like an idiot, I found a backslash in a column, than was not visble in full screen (col 160 +), after the invoke statement. I removed it an it solved the problem. I want to thank everybody for their help, I learned alot. Thanks!

baltoro

I once read a post by a C++ programmer (on another programming forum),...in which he had an large number of insidious errors when he tried to compile the program he was working on. It nearly drove him crazy,...and, took hours to determine the cause.
...As it turned out,...he had accidentally added a closing bracket (}) at some random point in one of the more commonly used windows headers files,...and, the compiler would respond by listing a whole bunch of irrelevant errors every time he tried to compile anything that referenced that header file.
...He suggested to all serious programmers that they make all Windows headers files 'Read Only',...to eliminate that kind of debacle in the future. :eek
Baltoro

NoCforMe

Quote from: Don57 on November 03, 2011, 06:00:14 PM
Went home and worked on it for a few more hours. I feel like an idiot, I found a backslash in a column  [...]

Idiot? No, that's just the price of admission to the programmer's club.

Gunner

Quote from: Don57 on November 03, 2011, 06:00:14 PM
Went home and worked on it for a few more hours. I feel like an idiot, I found a backslash in a column, than was not visble in full screen (col 160 +), after the invoke statement. I removed it an it solved the problem. I want to thank everybody for their help, I learned alot. Thanks!

Column 160?  I can get around 190 visible columns but I don't use them all!  You can use the line continuation character (backslash) to split invoke calls up...

        invoke CreateWindowEx, \
                    WS_EX_CLIENTEDGE, \
                    offset szWndTreeView, \
                    NULL, \
                    WS_CHILD or WS_VISIBLE or WS_TABSTOP or TVS_DISABLEDRAGDROP, \
                    5, 5, \
                    255, 280, \
                    hWin, TV_MAIN, \
                    hInst, NULL


Some API you would use many more constants and you could even split those up and use mulitple lines for those also.
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com