Hello,
i want to use the unmanaged code in CSharp.
the structure defined in the cpp dll is
typedef struct XTRAP_CLIENT_LI ST
{
char prnNetAdd[100];
char hostAddress[100];
XTYPE_ADDESS ClientType;
struct XTRAP_CLIENT_LI ST* next;
} XTRAP_CLIENT_LI ST;
typedef XTRAP_CLIENT_LI ST FAR * LPXTRAP_CLIENT_ LIST;
how to define this structure in c# .net. and how to use the function which is using the structure.
i have defined the structure as
public struct XTRAP_CLIENT_LI ST
{
[MarshalAs(Unman agedType.ByValT Str, SizeConst = 100)]
public string prnNetAdd;
[MarshalAs(Unman agedType.ByValT Str, SizeConst = 100)]
public string hostAddress;
public XTYPE_ADDESS ClientType;
public IntPtr next;
}
But i don't know how to use use the IntPtr in my function.
i want to use the unmanaged code in CSharp.
the structure defined in the cpp dll is
typedef struct XTRAP_CLIENT_LI ST
{
char prnNetAdd[100];
char hostAddress[100];
XTYPE_ADDESS ClientType;
struct XTRAP_CLIENT_LI ST* next;
} XTRAP_CLIENT_LI ST;
typedef XTRAP_CLIENT_LI ST FAR * LPXTRAP_CLIENT_ LIST;
how to define this structure in c# .net. and how to use the function which is using the structure.
i have defined the structure as
public struct XTRAP_CLIENT_LI ST
{
[MarshalAs(Unman agedType.ByValT Str, SizeConst = 100)]
public string prnNetAdd;
[MarshalAs(Unman agedType.ByValT Str, SizeConst = 100)]
public string hostAddress;
public XTYPE_ADDESS ClientType;
public IntPtr next;
}
But i don't know how to use use the IntPtr in my function.
Comment