[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

jlnm

10/19/2007 2:00:00 PM

I have to emulate a C++ Com Component in C# . One of the methods I
am
to provide int the C# COM is (the C++ signature):

STDMETHOD(SetAttributeArray)(/*[out]*/ long* retVal, /*[in]*/ VARIANT
AttributeArray);

My Plan is this:

[Guid("03AD5D2D-2AFD-439f-8713-A4EC07054432")]
interface IComTrial
{
int SetAttributeArray(out int data,
[MarshalAs(UnmanagedType.SafeArray)] System.Array data2);
}

[ClassInterface(ClassInterfaceType.AutoDual)]
[Guid("0490E147-F2D2-4909-A4B8-3533D2F2IED1")]
class CComTrial : IComTrial
{
public CComTrial()
{ }


public int SetAttributeArray(out int data, System.Array
data2)
{
return (0);
}
}

Does this work?

1 Answer

(Mattias Sjögren)

10/20/2007 5:04:00 PM

0

>Does this work?

I doubt it. I'd try it like this instead

void SetAttributeArray(out int data, object data2);


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.n... | http://www.dotneti...
Please reply only to the newsgroup.