I have a COM component, from a thirdy part so I cannot change it and the exposed COM interface,
in this interface there are two methods like you can see in this extract of the idl declaration:
[
object,
uuid(789df3f0-531b-11d8-a0b3-000c6e220a33),
pointer_default(unique)
]
interface IDicomElementUL: IDicomElement
{
[id(121)] HRESULT SetVectorData([in] ULONG* v,[in] long size);
[id(101)] HRESULT GetVectorData([out, size_is(size)] ULONG* val, [in] long size);
};
SetVectorData provide the way to pass a ULONG[size] array to the com component GetVectorData provide the way to read a ULONG[size] array from the com component
I try to import it in my C# application. of course I've generated my Interop file and add as a reference in my C# application Here in the following is the IL code generated
.method public hidebysig newslot abstract virtual
instance void GetVectorData([out] uint32& val,
[in] int32 size) runtime managed internalcall
{
} // end of method IDicomElementUL::GetVectorData
.method public hidebysig newslot abstract virtual
instance void SetVectorData([in] uint32& v,
[in] int32 size) runtime managed internalcall
{
} // end of method IDicomElementUL::SetVectorData
In my C# application I see these two method like
void GetVectorData(out uint val, int size); void SetVectorData(ref uint v, int size);
there is a way to write a read the ULONG array from c# to COM Compoment