On Wed, Jul 1, 2009 at 2:42 AM, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
horace wrote:

i got it to compile by manually replacing this:

__pyx_t_2 = PyInt_FromLong(((long)LoadIcon(((void *)((long)__pyx_t_3)), ((char *)1))));

with this:

__pyx_t_2 = PyInt_FromLong(((long)LoadIcon(((HINSTANCE)((long)__pyx_t_3)), ((char *)1))));

If the above two lines of C code aren't equivalent, then
HINSTANCE must be getting defined as something different
from void * from the C compiler's point of view.

At this point, if I were using gcc I would run it with
-M to find out what HINSTANCE is getting expanded into.
Not sure how to do that in a Windows environment, though.



i wasn't able to find any different HINSTANCE definition than void * but it could be that i missed the right one. it's really hard to find something like that on windows. maybe i will look for some tool which allows regular expressions for searching. i will also try to find out if i can do something like -M with the visual c++ compiler. thanks!





BTW, it appears that you're actually using Cython, not Pyrex,
because


 cdef HMODULE h = GetModuleHandle(<char *>0)

is not valid Pyrex code. You may want to ask about this
on the Cython list. The code that Pyrex generates for
what you posted earlier is quite different (although it
probably wouldn't work any better in this situation).



yes, i am using cython. i think i read somewhere that cython questions can or should also be asked on the pyrex list but i will look for the cython list next time. sorry!




--
Greg