Deriving from an ATL object?
-
Hi everybody, Does anybody know, how I can derive from an ATL object? I have an ATL 3.0 project and I want to have a base class (suppose CMyBase) with some members, and an interface (suppose IMyBase) with some exposed methods and properties. how do I create a new ATL object that is derived from that class? I mean that the new ATL object inherits members from CMyBase and methods and properties from IMyBase. Regards, Roozbeh.
-
Hi everybody, Does anybody know, how I can derive from an ATL object? I have an ATL 3.0 project and I want to have a base class (suppose CMyBase) with some members, and an interface (suppose IMyBase) with some exposed methods and properties. how do I create a new ATL object that is derived from that class? I mean that the new ATL object inherits members from CMyBase and methods and properties from IMyBase. Regards, Roozbeh.
First create the IBaseClass with pure virtual functions of your methods that you want to be derived. Create another class CBaseClass and inherite it from IBaseClass and implement the methods and functions. Now create a new simple ATL object, and in the list of inheritances, also include this CBaseClass. Now you need to add and implement the interface methods that is exposed to the world. If you are thinking of inheriting one COM object from another, then its not possible. Hope i got your question right.
MSN Messenger. prakashnadar@msn.com Tip of the day of visual C++ IDE. "We use it before you do! Visual C++ was developed using Visual C++"