C
Charlie
Hello everybody, I have a C++ function that returns a dynamical list of
structures.
....
typedef struct tagFOLDERITEM {
CString strFolderName;
HICON hIconSmall;
HICON hIconLarge;
} FOLDERITEM;
....
typedef CList<FOLDERITEM, FOLDERITEM> FolderItemList;
....
const FolderItemList *GetRecycleBinItems ();
....
I do not need these icons, only the name. Thats why I tryed:
....
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
public struct FolderItem
{
[MarshalAs(UnmanagedType.LPTStr)]
public string name;
[MarshalAs(UnmanagedType.AsAny)]
public object ic1;
[MarshalAs(UnmanagedType.AsAny)]
public object ic2;
}
....
[DllImport("RecycleBinDemo.dll", EntryPoint="GetRecycleBinItems",
SetLastError=true,
CharSet=CharSet.Auto, ExactSpelling=true,
CallingConvention=CallingConvention.StdCall)]
public static extern FolderItem[] GetRecycleBinItems();
....
I have no idea how to marshal CList and I can't find any suggestion on
the web. Any ideas or solutions? Thanks in advance.
Charlie
structures.
....
typedef struct tagFOLDERITEM {
CString strFolderName;
HICON hIconSmall;
HICON hIconLarge;
} FOLDERITEM;
....
typedef CList<FOLDERITEM, FOLDERITEM> FolderItemList;
....
const FolderItemList *GetRecycleBinItems ();
....
I do not need these icons, only the name. Thats why I tryed:
....
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
public struct FolderItem
{
[MarshalAs(UnmanagedType.LPTStr)]
public string name;
[MarshalAs(UnmanagedType.AsAny)]
public object ic1;
[MarshalAs(UnmanagedType.AsAny)]
public object ic2;
}
....
[DllImport("RecycleBinDemo.dll", EntryPoint="GetRecycleBinItems",
SetLastError=true,
CharSet=CharSet.Auto, ExactSpelling=true,
CallingConvention=CallingConvention.StdCall)]
public static extern FolderItem[] GetRecycleBinItems();
....
I have no idea how to marshal CList and I can't find any suggestion on
the web. Any ideas or solutions? Thanks in advance.
Charlie