Click here to Skip to main content
15,891,905 members
Home / Discussions / COM
   

COM

 
Questionautomatic call Pin
_tasleem27-Aug-06 22:04
_tasleem27-Aug-06 22:04 
AnswerRe: automatic call Pin
prasad_som27-Aug-06 23:19
prasad_som27-Aug-06 23:19 
QuestionThread in COM DLL Pin
rockryan27-Aug-06 3:03
rockryan27-Aug-06 3:03 
AnswerRe: Thread in COM DLL Pin
rockryan27-Aug-06 14:22
rockryan27-Aug-06 14:22 
QuestionIHTMLDocument2 get_applets Pin
nemo26-Aug-06 13:45
nemo26-Aug-06 13:45 
Question"Unadvising" Event sink in VB6 Pin
Ilia Blank25-Aug-06 7:45
Ilia Blank25-Aug-06 7:45 
GeneralRe: "Unadvising" Event sink in VB6 Pin
Guffa25-Aug-06 8:53
Guffa25-Aug-06 8:53 
QuestionDeriving multiple interfaces from base interface (aggregation) Pin
Andre xxxxxxx24-Aug-06 4:38
Andre xxxxxxx24-Aug-06 4:38 
I would like to derive multiple interfaces from the same base interface.
In the IDL file I have the following:

<br />
interface IBase : IUnknown<br />
{<br />
   HRESULT BaseFunc ();<br />
};<br />
<br />
interface IDerived1 : IBase<br />
{<br />
   HRESULT Derived1Func ();<br />
};<br />
<br />
interface IDerived2 : IBase<br />
{<br />
   HRESULT Derived2Func ();<br />
};<br />


This actually works, but I guess that's the wrong approach, because if I now implement the interfaces in C++ that doesn't work well.

<br />
class CBase : public IBase ...<br />
class CDerived1 : public IDerived1 ...<br />
class CDerived2 : public IDerived2 ...<br />


CDerived1 and CDerived2 would then have to re-implement the methods of CBase. This could be avoided by making CBase a template, but is this actually how it should been done?

Or is this the correct way?

class CDerived1 : public CBase, public IDerived1<br />
{<br />
};



The IBase interface should be exposed to the clients of the IDerived interfaces and the implementation is the same for all derived interfaces.


I haven't found any examples where multiple interfaces are derived from a base interface, it would be great to see same sample code.

Thanks
AnswerRe: Deriving multiple interfaces from base interface (aggregation) Pin
Stephen Hewitt24-Aug-06 17:44
Stephen Hewitt24-Aug-06 17:44 
GeneralRe: Deriving multiple interfaces from base interface (aggregation) Pin
Andre xxxxxxx25-Aug-06 3:48
Andre xxxxxxx25-Aug-06 3:48 
GeneralRe: Deriving multiple interfaces from base interface (aggregation) Pin
Stephen Hewitt26-Aug-06 2:43
Stephen Hewitt26-Aug-06 2:43 
QuestionCalling a ATL COM DLL interface from VBScript routine Pin
AKSIVAKUMAR23-Aug-06 23:21
AKSIVAKUMAR23-Aug-06 23:21 
AnswerRe: Calling a ATL COM DLL interface from VBScript routine Pin
Andre xxxxxxx24-Aug-06 12:11
Andre xxxxxxx24-Aug-06 12:11 
GeneralRe: Calling a ATL COM DLL interface from VBScript routine Pin
AKSIVAKUMAR25-Aug-06 7:51
AKSIVAKUMAR25-Aug-06 7:51 
QuestionBest practice for strings Pin
Andre xxxxxxx23-Aug-06 9:47
Andre xxxxxxx23-Aug-06 9:47 
AnswerRe: Best practice for strings Pin
Mike Dimmick23-Aug-06 10:25
Mike Dimmick23-Aug-06 10:25 
GeneralRe: Best practice for strings Pin
Andre xxxxxxx23-Aug-06 11:02
Andre xxxxxxx23-Aug-06 11:02 
GeneralRe: Best practice for strings Pin
Mike Dimmick23-Aug-06 13:49
Mike Dimmick23-Aug-06 13:49 
QuestionEthernet Programming Pin
Muhammad Azeem Azam22-Aug-06 23:01
Muhammad Azeem Azam22-Aug-06 23:01 
AnswerRe: Ethernet Programming Pin
Mike Dimmick23-Aug-06 0:22
Mike Dimmick23-Aug-06 0:22 
QuestionNamespace in IDL Pin
Andre xxxxxxx22-Aug-06 11:56
Andre xxxxxxx22-Aug-06 11:56 
AnswerRe: Namespace in IDL Pin
Steve S22-Aug-06 21:56
Steve S22-Aug-06 21:56 
GeneralRe: Namespace in IDL Pin
Andre xxxxxxx23-Aug-06 2:30
Andre xxxxxxx23-Aug-06 2:30 
GeneralRe: Namespace in IDL Pin
Steve S23-Aug-06 3:07
Steve S23-Aug-06 3:07 
QuestionCreate a Thread in COM dll but thread "HANG the whole COM DLL"~ Pin
rockryan21-Aug-06 8:19
rockryan21-Aug-06 8:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.