Jump to content
  • Advertisement

Archived

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

origil

A probably simple windows API problem

This topic is 6476 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

I''m reading the book called "Tricks of the Windows Game Programming Gurus" by Andre LaMothe. Upon one of the example my compiler (Borland) had a problem with the following: WNDCLASSEX winclass; winclass.hbrBackground = GetStockObject(BLACK_BRUSH); Error: Cannot convert ''void *'' to ''HBRUSH *''. How can this be fixed?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Change the line to :

winclass.hbrBackground = (HBRUSH*)GetStockObject(BLACK_BRUSH);

This typecasts the void* to HBRUSH*.

This should solve your problem.

Arun

Share this post


Link to post
Share on other sites
Change the line to :

winclass.hbrBackground = (HBRUSH*)GetStockObject(BLACK_BRUSH);

This typecasts the void* to HBRUSH*.

This should solve your problem.

Arun

Share this post


Link to post
Share on other sites
I should work on type-casting I guess.
Thanks but the compiler didn't like the type-casting,
had to remove the * from the typecasting:
from
winclass.hbrBackground = (HBRUSH*)GetStockObject(BLACK_BRUSH);
to
winclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
probably a typo. Thanks though.

Edited by - origil on March 17, 2001 3:11:39 PM

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!