cannot convert from 'void *' to 'struct HPEN__ *'??????HELP!

Started by
5 comments, last by PPCThug 22 years, 2 months ago
old_pen = SelectObject(hgdc, black_pen); error C2440: ''='' : cannot convert from ''void *'' to ''struct HPEN__ *'' Conversion from ''void*'' to pointer to non-''void'' requires an explicit cast Please help! remember I''m a newbie. the Particle Projection Cannon fires a shimmering blue bolt, much like a cross between lightning and a sine wave that ripples along its path.
Bloodshed Dev-C++ 4.9.8.0 Mingw DX 9.0a DX SDK 6.1win2k#define WIN32_LEAN_AND_MEANthe Particle Projection Cannon fires a shimmering blue bolt, much like a cross between lightning and a sine wave that ripples along its path.mechwarrior 2 mercenaries, 4 particle projection cannons, thug chassis
Advertisement
You have to cast it.

old_pen = (HPEN) SelectObject(hgdc, black_pen);
You need to cast the void pointer (void*) to whatever type you are using, for example an HPEN*.

So, old_pen = (HPEN*)SelectObject(hgdc, black_pen); would probably work.

-Marc
You have to cast it.

old_pen = (HPEN) SelectObject(hgdc, black_pen);
You have to cast it.

old_pen = (HPEN) SelectObject(hgdc, black_pen);
Aplogies for the repeated post. Go and tell my ISP www.blueyonder.co.uk to get some fucking webcaches that work properly please.

ok, Thanks!


the Particle Projection Cannon fires a shimmering blue bolt, much like a cross between lightning and a sine wave that ripples along its path.
Bloodshed Dev-C++ 4.9.8.0 Mingw DX 9.0a DX SDK 6.1win2k#define WIN32_LEAN_AND_MEANthe Particle Projection Cannon fires a shimmering blue bolt, much like a cross between lightning and a sine wave that ripples along its path.mechwarrior 2 mercenaries, 4 particle projection cannons, thug chassis

This topic is closed to new replies.

Advertisement