tags:

views:

15

answers:

1
a.hbrBackground=GetStockObject(WHITE_BRUSH);

error: cannot convert from 'void *' to 'struct HBRUSH__ ' Conversion from 'void' to pointer to non-'void' requires an explicit cast

Cannot execute the above code in vc++

Please check the code.

+1  A: 

That's normal for GetStockObject. You just need to cast it

a.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
Rup
Yup, unfortunate side-effect of a C API. GetStockObject can return different types of objects.
MSalters