D
Dave
I wish to call a COM Object which has a parameter of type VARIANT* on
a method call from C#
The COM Method :-
STDMETHODIMP CClassType::GetTypeIDs(VARIANT * TypeIDs)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
if (DeviceTypeIDs->vt != (VT_I2|VT_ARRAY))
return E_INVALIDARG ;
VARIANT* ptr ;
SafeArrayAccessData (TypeIDs->parray, (void**) &ptr) ;
ptr[0].iVal = 1 ;
ptr[1].iVal = 2;
ptr[2].iVal = 3;
ptr[3].iVal = 4;
ptr[4].iVal = 5;
ptr[5].iVal = 6;
SafeArrayUnaccessData (TypeIDs->parray) ;
return S_OK;
}
How do I create the parameter required within C# in order to call this
COM Method. I've read quite a few postings on marshalling and the
such, but is there anyone that can explain this in simple terms or
code samples would be good.
I think my main problem is C# knowledge, as I have only just started
using it
TIA for even the smallest hint on how to resolve this problem
a method call from C#
The COM Method :-
STDMETHODIMP CClassType::GetTypeIDs(VARIANT * TypeIDs)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
if (DeviceTypeIDs->vt != (VT_I2|VT_ARRAY))
return E_INVALIDARG ;
VARIANT* ptr ;
SafeArrayAccessData (TypeIDs->parray, (void**) &ptr) ;
ptr[0].iVal = 1 ;
ptr[1].iVal = 2;
ptr[2].iVal = 3;
ptr[3].iVal = 4;
ptr[4].iVal = 5;
ptr[5].iVal = 6;
SafeArrayUnaccessData (TypeIDs->parray) ;
return S_OK;
}
How do I create the parameter required within C# in order to call this
COM Method. I've read quite a few postings on marshalling and the
such, but is there anyone that can explain this in simple terms or
code samples would be good.
I think my main problem is C# knowledge, as I have only just started
using it
TIA for even the smallest hint on how to resolve this problem