Advertisement

Win32 in VC6

Started by January 31, 2000 10:20 AM
1 comment, last by kp 24 years, 10 months ago
Hi! I''m trying to compile a win32 application in VC6. I''ve previously used VC5 and I''ve encoutered some troubles. In my int WINAPI WinMain(HINSTANCE hinstance, ... I write the following: GetStockObject(BLACK_BRUSH); But I get an error: : error C2440: ''='' : cannot convert from ''void *'' to ''struct HBRUSH__ *'' Conversion from ''void*'' to pointer to non-''void'' requires an explicit cast Can someone please help me and tell me what to do.
Ok. I wrote:

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

And now it works fine.
Advertisement
VC6 is a lot more picky about type casting than previous versions of VC, so don''t be terribly surprised when it gives you errors like that... just try casting to the type you''re expecting (like you did) and it should be fine.

-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~

This topic is closed to new replies.

Advertisement