How to deal with pointer field in struct in idl So that C# can call C++ COM?
e.g.
in C++ COM Server IDL:
typedef struct
{
long *xPos;
long yPos;
} MYPOINT;
...
...
interface IIDraw : IUnknown
{
HRESULT DrawALine([in,out] MYPOINT* p1, [in,out] MYPOINT* p2);
};
in C# Client:
// We want to remove the * (pointer) of xPos.
// The class will become:
public class MYPOINT
{
public long xPos;
public long yPos;
};
// When calling the COM function:
MYPOINT pt1, pt2;
draw.DrawALine(ref pt1, ref pt2);
How to make this kind of implementation?
Is it required to modify the IL Assembler file for certain marshaling? If yes, how?
--------------------------------
From: Lawrence Li
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>zOQ+8DNeTEWO1dMmzgHuHA==</Id>