September 6th, 2010, 06:04 AM
How to pass double pointers for COM Interop via MethodInfo.Invoke ?
I need to make COM IntetrOp at runtime using reflections. My native COM Object's exposed methods have some parameters as pointers (DWORD*) and some double pointers (DWORD**) and some are user defined types(e.g SomeUDTType objSmeUDTType) and its pointer to pointer(i.e. SomeUDTType **pSomeUDTType).
I need to pass pointers to pointers. For now how can I be able to populate "object" array as pointers to pointers of SomeUDTType.
Native COM exposed method :
STDMETHODIMP MyCallableMethod(DWORD *value_1,BSTR *bstrName,WESContext **a_wesContext
tlbImp generated output:
DTINIDLLib.RuntimeCallingClass.MyCallableMethod(ref uint, ref string, System.IntrPtr)
Last edited by glitteringsound; September 6th, 2010 at 06:10 AM.
September 7th, 2010, 06:31 AM
Re: How to pass double pointers for COM Interop via MethodInfo.Invoke ?
Hmm ... no answers.
The only thing I can suggest is having a look at mixed mode C++/CLI. You'd create a DLL which contains both .net code and native C++ code. That way you could pass the data to the mixed mode DLL in a .net friendly way and then convert it so that you can call the COM functions.
Maybe this article can help: http://www.codeproject.com/KB/mcpp/C___CLI_Primer.aspx
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!