Archived

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

PPCThug

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

Recommended Posts

PPCThug    130
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
You have to cast it.

old_pen = (HPEN) SelectObject(hgdc, black_pen);

Share this post


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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
You have to cast it.

old_pen = (HPEN) SelectObject(hgdc, black_pen);

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
You have to cast it.

old_pen = (HPEN) SelectObject(hgdc, black_pen);

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Aplogies for the repeated post. Go and tell my ISP www.blueyonder.co.uk to get some fucking webcaches that work properly please.

Share this post


Link to post
Share on other sites
PPCThug    130
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.

Share this post


Link to post
Share on other sites