CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2005
    Posts
    19

    Calling a COM dll from another COM dll

    Hi,

    Please suggest how to call a COM dll from another COM dll in VC++ 6.0?

    I have a requirement in which I have to call a COM dll built in VC++ 9.0 in another COM dll which is VC++ 6.0.

  2. #2
    Join Date
    Jan 2007
    Posts
    90

    Re: Calling a COM dll from another COM dll

    hello,

    in its simplest form

    you will need to create the COM object inside the COM DLL.

    say Client application initiate COM DLL one

    by executing lines like

    ICOMDLLPtr pCOMDLL (__uuidof(COMDLL));

    pCOMDLL ->CallDiffrentCOMFunction()



    in the CallDiffrentCOMFunction() in side the COM DLL

    {
    ICOMDLL2Ptr pCOMDLL2 (__uuidof(COMDLL2));

    pCOMDLL2 ->CallAnotherFunction()

    }

    NOTE: however as your COM application gets complex, you will need to understand logic behind apartments, marshaling etc..


    regard
    deepak

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured