dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]Adding ICalls and Implementing Directory.cs


From: Rhys Weatherley
Subject: Re: [DotGNU]Adding ICalls and Implementing Directory.cs
Date: Wed, 23 Oct 2002 08:25:12 +1000

Gopal V wrote:

> I've fixed all these minor issues and commited to CVS ... but still
> cannot seem to get String into FileInfo struct ...

Except that you forgot to check in the pnetlib changes, so it is
was impossible for me to compile it and regenerate int_proto.h.
I've temporarily disabled the code in "lib_dir.c" because it is
breaking the CVS tree build.

> Rhys: could you tell me & Charles where we went wrong ?.

You are creating the array incorrectly.  It is an array of structs,
not objects.  Don't do this:

    buffer = (Platform_FileInfo **)(ArrayToBuffer(*files));
    ...
    *buffer= (Platform_FileInfo*) ILExecThreadNew(_thread,
                        "Platform.FileInfo","(T)V");
    ...
    (*buffer)->fileName = ILStringCreate(_thread, dirEntry->d_name);

Instead, do this:

    buffer = (Platform_FileInfo *)(ArrayToBuffer(*files));
    ...
    buffer->fileName = ILStringCreate(_thread, dirEntry->d_name);

The members are already allocated and initialised.  All you need
to do is fill them.

Cheers,

Rhys.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]