Skip to main content
gamedev.net
🔒 Locked

window setup

Started by node_5r Apr 11, 2000 at 8:57 PM 1 replies 500+ views
Original Post
node_5r
node_5r
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
Epoch
Epoch
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"

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

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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.