i have just finished the subclassing thing i wanted to do, and so i tried it, but the first thing i get is an illegal operation..i ahve looked now for more than 3hrs, and i was wondering if anybody wouldn't mind helping
thanks
Printable View
i have just finished the subclassing thing i wanted to do, and so i tried it, but the first thing i get is an illegal operation..i ahve looked now for more than 3hrs, and i was wondering if anybody wouldn't mind helping
thanks
i figured out it has something to do with the window not having a wndproc or something, cuz it does the clipmessage without errors, and then when i move the mouse over the window it gives me the illegal operation
A) I wonder this compiles:
ClipMessage(sTest, hwnd, WM_LBUTTONDOWN);
B) This class is poorly written (just try adding a second cpp file to your project and including the .h file there too. Or include the .h file twice in the same cpp)
C) You have a strange coding style. WS_BORDER may not be supplied as ex window style. Why use CreateWindowEx when you don't use the ex style? Why supply NULL (void*) to the window style (unsigned int)? Why...
D) WndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW);
must be
WndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
...
Well, actually I can't read this code, especially not the class functions. Therefore I can't help you with your particular problem. But you should learn to write cleaner code.