CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: [VC++,COM] Do VB "Implements" in VC++

  1. #1
    Join Date
    Jun 2001
    Posts
    2

    [VC++,COM] Do VB "Implements" in VC++

    Hi,

    I want to create a COM DLL who implements the interfaces defined in
    another COM dll (type library) where the interfaces are not implemented.

    That's exactly what VB can do with "Implements".

    But i should do it in VC++, how can i do it?

    I watn to do like this:

    1) Create MFC dll project with Automation, include COM dll Type library
    in "Object/Library modules".
    2) in MyClass.h:
    DECLARE_INTERFACE_MAP();

    BEGIN_INTERFACE_PART(MyNestedClass,IMyInterface)
    STDMETHOD(..);
    STDMETHOD(..);
    END_INTERFACE_PART(MyNestedClass)
    3) in MyClass.cpp:
    BEGIN_INTERFACE_MAP(MyClass,CCmdTarget)
    INTERFACE_PART(MyClass,IID_IMyInterface,MyNestedClass);
    END_INTERFACE_MAP()

    Is that ok?

    Thanks,

    Ruotao


  2. #2
    Join Date
    May 1999
    Location
    Germany
    Posts
    106

    Re: [VC++,COM] Do VB "Implements" in VC++

    Hi,

    use oleview.exe (shipped with Visual Studio) to load the type library and generate an .IDL file.
    Then use MIDL compiler to generate a .H and a .CPP file.

    Bye
    Peter


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




On-Demand Webinars (sponsored)