Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

node_5r

window setup

This topic is 6706 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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"

Share this post


Link to post
Share on other sites
VC++ 6 has stricter type casting than its previous version..

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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!