[Pyrex] compiler requires explicit cast?

horace horace3d at gmail.com
Wed Jun 24 13:03:44 CEST 2009


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.copyleft.no/pipermail/pyrex/attachments/20090624/d5757de9/attachment.html>


More information about the Pyrex mailing list