Le mercredi 14 janvier 2015 à 05:32 -0800, J Luis a écrit :
> Hi,
> I have had quite some head-aches with types (converted from C structs)
> but this one wins.
> 
> I have this type (from IUP)
> 
> 
> type tCTC
>     iup_canvas::Ptr{cdCanvas}
>     w::Cint
>     h::Cint
> ...
> 
> which I initialize as
> 
> ctgc = tCTC(
>         convert(Ptr{cdCanvas},0),
>         int32(0), int32(0),
> ...
> 
> and now the mystery.
> 
>     t = cdCreateCanvas(cdContextIup(), IupGetHandle("cnvMain"))
>     ctgc.iup_canvas = t
>     cdActivate(t);
>     cdActivate(ctgc.iup_canvas);
> 
> 
> the last line in the chunk above errors with
> 
> 
> ERROR: `cdActivate` has no method matching cdActivate(::Ptr{cdCanvas})
>  in CDTestInit at C:\programs\Gits\IUP.jl\examples\cdtest_.jl:125
>  in cdtest at C:\programs\Gits\IUP.jl\examples\cdtest_.jl:92
> 
> 
> So `t` and `ctgc.iup_canvas` are actually two different entities
> (although their pointers are ofc the same as I can see if I @show
> them)?
Well, you need to show us more details, e.g. tell us what
cdCreateCanvas() does, and what type it returns. The pointers might hold
the same address, but they still may be of different types. @show should
make this visible, but without the output we cannot check.


Regards

Reply via email to