compiler requires explicit cast?
horace <[email protected]> Wed, 24 Jun 2009 13:03:44 +0200
| Newsgroups | gmane.comp.python.pyrex |
|---|---|
| Message-ID | <[email protected]> |
--===============2092996370==
Content-Type: multipart/alternative; boundary=001636c5bf728c174b046d160fb8
--001636c5bf728c174b046d160fb8
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
hi,
the visual c++ compiler always gives me this error message:
error C2664: 'LoadIconA' : cannot convert parameter 1 from 'void *' to
'HINSTANCE'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
this is what i try do:
cdef extern from "windows.h":
ctypedef void *PVOID
ctypedef PVOID HANDLE
ctypedef HANDLE HICON
ctypedef HANDLE HINSTANCE
ctypedef HINSTANCE HMODULE
HMODULE GetModuleHandle(char *lpModuleName)
HICON LoadIcon(HINSTANCE hInstance, char *lpIconName)
...
cdef HMODULE h = GetModuleHandle(<char *>0)
LoadIcon(<HINSTANCE>h, <char *>1)
maybe someone has an idea how to fix this problem? i wasn't able to figure
it out.
--001636c5bf728c174b046d160fb8
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
hi,<br><br>the visual c++ compiler always gives me this error message:<br><=
br>error C2664: 'LoadIconA' : cannot convert parameter 1 from '=
void *' to 'HINSTANCE'<br>Conversion from 'void*' to po=
inter to non-'void' requires an explicit cast<br>
<br>this is what i try do:<br><br><br><div style=3D"margin-left: 40px;">cde=
f extern from "windows.h":<br>=A0=A0=A0 ctypedef void *PVOID<br>=
=A0=A0=A0 ctypedef PVOID HANDLE<br>=A0=A0=A0 ctypedef HANDLE HICON<br>=A0=
=A0=A0 ctypedef HANDLE HINSTANCE<br>
=A0=A0=A0 ctypedef HINSTANCE HMODULE<br>=A0=A0=A0 HMODULE GetModuleHandle(c=
har *lpModuleName)<br>=A0=A0=A0 HICON LoadIcon(HINSTANCE hInstance, char *l=
pIconName)<br><br>...<br><br>cdef HMODULE h =3D GetModuleHandle(<char *&=
gt;0)<br>LoadIcon(<HINSTANCE>h, <char *>1)<br>
</div><br><br><br>maybe someone has an idea how to fix this problem? i wasn=
't able to figure it out.<br>
--001636c5bf728c174b046d160fb8--
--===============2092996370==
Content-Type: text/plain; charset="iso-8859-1"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
_______________________________________________
Pyrex mailing list
[email protected]
http://lists.copyleft.no/mailman/listinfo/pyrex
--===============2092996370==--