No, unfortunately changing to immutable does no good either.
The problem originally is that I get a 'no method' error in this code

@show typeof(cd_canvas)
@show methods(cdCanvasActivate)
    cdCanvasActivate(cd_canvas);

which prints

typeof(cd_canvas) => Ptr{cdCanvas}
methods(cdCanvasActivate) => # 1 method for generic function 
"cdCanvasActivate":
cdCanvasActivate(canvas::Ptr{cdCanvas}) at 
C:\programs\Gits\IUP.jl\src\libcd.jl:278
ERROR: `cdCanvasActivate` has no method matching 
cdCanvasActivate(::Ptr{cdCanvas})

I have once crossed a similar situation that turned out to be due to the 
type being defined in two files, but multiple-checked and that's not the 
case here.
Actually the error is not restricted to this cdCanvasActivate() function 
but happens with any function that has the same signature. Hence my 
suspicious with cdCanvas Type.
 

quinta-feira, 8 de Janeiro de 2015 às 23:40:47 UTC, J Luis escreveu:
>
> Hi,
>
> I need to convert a structure of function pointers into a composite type. 
> The struct looks like this
>
> struct cdCanvas {
>   void   (*cxPixel)(cdCtxCanvas* ctxcanvas, int x, int y, long color);
>   void   (*cxLine)(cdCtxCanvas* ctxcanvas, int x1, int y1, int x2, int y2);
>   void   (*cxPoly)(cdCtxCanvas* ctxcanvas, int mode, cdPoint* points, int 
> n);
> ...
>
> used Clang.jl but it converted it to
>
> type cdCanvas
>     cxPixel::Ptr{Void}
>     cxLine::Ptr{Void}
>     cxPoly::Ptr{Void}
> ...
>
> which is not correct (ccall crash when using this type), but I don't know 
> either how to write it manually.
>
> Any advise?
>
> Thanks
>

Reply via email to