Solved

Inheriting from a COM Implementation class

Posted on 2002-06-10
1
267 Views
Last Modified: 2010-05-18
I have a COM interface in the .idl file that looks like this:
import "oaidl.idl";
import "ocidl.idl";
import "myBase.idl";
     [
          object,
          uuid(E655B3C6-05EC-4A1B-B08F-488826F25234),
     
          helpstring("ISymbol Interface"),
          pointer_default(unique)
     ]
     interface IDerivedSymbol : IBaseSymbol
     {
      //added 2 additional methods here    

     };

[
     uuid(A66139F8-A5FE-4CC0-AE92-ECEB0019B263),
     version(1.0),
     helpstring("1.0 Type Library")
]
library SYMBOLLib
{
     importlib("stdole32.tlb");
     importlib("stdole2.tlb");
     [
          uuid(C2827C0A-16E4-4364-854A-179BE3D33A88),
          helpstring("Symbol Class")
     ]
     coclass DerivedSymbol
     {
          [default] interface IDerivedSymbol;
               
        }
};
My implementaion class of the IDerivedSymbol interface is called CDerivedSymbol
How do I inherit the implementation class of the IBaseSymbol interface,(CBaseSymbol) so I can just reuse the existing methods in that interface.

Thanks
0
Comment
Question by:borghard
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 400 total points
ID: 7067361
Check http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/com_0pyr.asp ("COM - Reusing Objects") as a good starting point into the docs - in COM, this is accomplished by using containment/delegation and aggregation.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need some help with listview limit text 20 103
Least Squares Curve Fitting 4 77
VS2015 Redefinition errors 4 47
Android development question 2 34
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

805 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question