Clarification on some COM Doubts

Discussion in 'C++' started by UnfitElf, Jun 23, 2010.

  1. UnfitElf

    UnfitElf New Member

    Jun 23, 2010
    Likes Received:
    Trophy Points:
    Hi all :)

    I've been reading up about COM for a current project and i would like some clarification on one point. Please excuse if the following is not described clearly enough, im still trying to get an undistorted view of things myself.

    All the examples i've come across create an interface and an implementation in the same server exe or dll. What would you do in the situation where you want to have one interface but multiple implementations?

    Currently i've created an IDL file which describes the interface, compiling this i get the .tlb. From this i can use "Implement Interface" selection in visual studio to automatically add in the required entries into the COM map etc for each new server created. I then need to update the server's IDL file to importlib the .tlb and add the interface to the server's coclass interface list. Finally i make sure the original .tlb file is registered.

    This seems to work however is there another way to achieve the goal? Im wondering if i can use the original interface IDL file with the server instead of it creating a new one and having to import the tlb?


Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice