[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

pointer to pointer in struct

Aditya Vaish

3/22/2007 11:09:00 AM

Hi

I have an unmanaged dll have struct defined

struct DirList
{
char **elements /* [] */ ;
int32 *attributes /* [] */ ;
int64 *mtime /* [] */ ;
int64 *fsize /* [] */ ;
int32 num_elements ;
} ;
and the call to get the dirlist is
FT_dirList(SessionHandle *handle,const char *remoteDirName,DirList
**dirlist,NBTicket *nbticket) ;

in the managed code
the struct
public struct DirList
{
public IntPtr elements /* [] */ ;
public IntPtr attributes /* [] */ ;
public IntPtr mtime /* [] */ ;
public IntPtr fsize /* [] */ ;
public int num_elements;
} ;
and the call is
FT_dirList(ref session, "/", out outptr, IntPtr.Zero);
The problem is that if i use string[] instrad intptr in elements, there is
an exception and elements in null. If i use IntPtr, how should i retrieve the
array of strings?

Regards
Aditya