[Mono-dev] [Embedded] GetEnumerator on a List<int>

Zoltan Varga vargaz at gmail.com
Tue Apr 5 04:24:12 EDT 2011


Hi,

  In this line:

        printf ("%u\n", *(bool*)mono_object_unbox( mono_runtime_invoke
(moveNext, enumerator,
                                                        NULL, NULL)));

You probably have to change 'moveNext' to 'mono_object_unbox(moveNext)'.

           Zoltan

On Tue, Apr 5, 2011 at 10:05 AM, Viktor Hermansson <
viktor.hermansson at gmail.com> wrote:

> On Mon, 4 Apr 2011 15:37:07 +0200
> Zoltan Varga <vargaz at gmail.com> wrote:
>
> > Hi,
> >
> >   Enumerator is probably a valuetype, and those have to be unbox-ed
> > before passing them to mono_runtime_invoke ().
> >
> >                        Zoltan
>
> If I do that it can't find the MoveNext()-method, so that's probably
> not the issue or did I misinterpret your idea?
>
> /Viktor
>
> >
> > On Mon, Apr 4, 2011 at 2:10 PM, viktor.hermansson <
> > viktor.hermansson at gmail.com> wrote:
> >
> > > I have a problem to use an Enumerator in the unmaneged world.
> > >
> > > When I execute MoveNext() it doesn't return the expected value
> > > (true).
> > >
> > > example code:
> > > (an extension to Roberts code here:
> > > http://go-mono.com/forums/#nabble-td1538089)
> > >
> > > c++-code:
> > > http://pastebin.com/aMHmnHRC
> > >
> > > c#-code:
> > > http://pastebin.com/MpktHBTB
> > >
> > > platform:
> > > Linux 2.6.38 64bit
> > > Mono git snapshot and 2.10.1
> > > GCC 4.6.0
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> http://mono.1490590.n4.nabble.com/Embedded-GetEnumerator-on-a-List-int-tp3425288p3425288.html
> > > Sent from the Mono - Dev mailing list archive at Nabble.com.
> > > _______________________________________________
> > > Mono-devel-list mailing list
> > > Mono-devel-list at lists.ximian.com
> > > http://lists.ximian.com/mailman/listinfo/mono-devel-list
> > >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110405/fdfc1665/attachment.html 


More information about the Mono-devel-list mailing list