How to pass double pointers for COM Interop via MethodInfo.Invoke ?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: How to pass double pointers for COM Interop via MethodInfo.Invoke ?

  1. #1
    Join Date
    Jan 2010
    Posts
    53

    How to pass double pointers for COM Interop via MethodInfo.Invoke ?

    Hello,

    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)


    Regards
    Usman
    Last edited by glitteringsound; September 6th, 2010 at 06:10 AM.

  2. #2
    Join Date
    Apr 2004
    Location
    England, Europe
    Posts
    2,492

    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
    My hobby projects:
    www.rclsoftware.org.uk

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center