http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (no subject)



On Sat, 7 Oct 2000 Eldemar@aol.com wrote:

> Any help on this type of error?  It looks like something simple, like 
> changing a type, but I can't figure it out.

	This is exactly what it is.

> C:\Program Files\Microsoft Visual Studio\MyProjects\Chap9\dirdraw.cpp(90) : 
> error C2664: 'LoadIconA' : cannot convert parameter 1 from 'void *' to 
> 'struct HINSTANCE__ *'
>         Conversion from 'void*' to pointer to non-'void' requires an explicit 
> cast

>     wc.hIcon =          LoadIcon (hInst, IDI_APPLICATION);

> Can I tell my compilker not to check types so strickly?

	No, that would be evil.  Instead we properly cast the objects.

wc.hIcon = static_cast<#the type it needs#>(LoadIcon( hInst,  \
IDI_APPLICATION));

Where #the type it needs# is something like HICON or somesuch.  If
'static_cast' does not work, then use 'reinperpret_cast'.

--
Marc Hernandez

=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once

To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html