Returning an array of objects from C# to COM/C++? |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Posted: 19 April 2010 at 11:38am |
I have written a COM component in C#. One of the interfaces contains a function that must return a list of objects of another exported interface:
[DispId(1)]
void GetList(ref MyClass[] list);
This is no rocket science as long as we stay in the world of .NET, but in MFC we find ourselves in hell:
void GetList(SAFEARRAY * * list)
{
static BYTE parms[] = VTS_UNKNOWN;
InvokeHelper(0x1, DISPATCH_METHOD, VT_EMPTY, NULL, parms, test);
}
Q1: Is this the preferred way of returning an array of objects from a COM object?
Q2: How do I instansiate the MyClass objects on the C++ side? |
|
PokerMemento - http://www.pokermemento.com/
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |