window setup

Started by
1 comment, last by node_5r 24 years ago
Hi all, I am currently learning windows programming. I have the book windows95 programming for dummies.(bargin bin for $5)Now i typed in the first program i.e. Hello world. This hello world is the windows one. I had one error. This is the section of code with my error in it. wndClass.style =0; wndClass.lpfnWndProc = WindowProc; //callback fn wndClass.cbClsExtra = 0; wndClass.cbWndExtra = 0; wndClass.hInstance = hInstance; wndClass.hIcon = LoadIcon(NULL,IDI_APPLICATION); wndClass.hCursor = LoadCursor(NULL, IDC_ARROW); wndClass.hbrBackground = GetStockObject(WHITE_BRUSH); wndClass.lpszMenuName = NULL; wndClass.lpszClassName = szAppName; sorry message board messed it up a bit but my error is in the line with the wndClass.hbrBackground = GetStockObject(WHITE_BRUSH). Now when i compile it says it cant convert a void to a brush. Now what the heck does that mean???? Can some one be so kind as to help me with this problem? thanks, node_5r
Advertisement
umm, i don''t know if this will help but try:
wndClass.hbrBackground= (HBRUSH) GetStockObject(WHITE_BRUSH);

Otherwise I''m not really sure why it would say "can''t convert void to hbrush"

VC++ 6 has stricter type casting than its previous version..

so just cast it to a (HBRUSH) and all is well..

This topic is closed to new replies.

Advertisement