Can someone please tell me how to marshall the following?
enum
{
LIFFE_SIZE_AUTOMARKETREF = 15
};
typedef char LiffeAutoMarketReference [LIFFE_SIZE_AUTOMARKETREF];
typedef struct _tagLiffeSettlementList
{
struct _tagLiffeSettlementList* pcNext;
LiffeAutoMarketReference achMarketRef;
int nSettlementPrice;
} LiffeSettlementList;
Would this be correct?
[StructLayout(LayoutKind.Sequential)]
public class LiffeSettlementList
{
public LiffeSettlementList pcNext;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=15)] public string achMarketRef;
public int nSettlementPrice;
}
or would it be something like
[StructLayout(LayoutKind.Sequential)]
public class LiffeSettlementList
{
public IntPtr pcNext;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=15)] public string achMarketRef;
public int nSettlementPrice;
}
Thanks for the help,
Thomas
Mattias Sj?gren - 19 Dec 2004 23:03 GMT
Thomas,
>or would it be something like
>[StructLayout(LayoutKind.Sequential)]
[quoted text clipped - 4 lines]
> public int nSettlementPrice;
>}
This is what I'd use.
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.