Click here to Skip to main content
15,926,174 members
Home / Discussions / COM
   

COM

 
QuestionDataGrid in MFC? Pin
Franken13-Nov-06 1:23
Franken13-Nov-06 1:23 
Questionquestion about activex compability Pin
ingsgr01@gmail.com13-Nov-06 0:47
ingsgr01@gmail.com13-Nov-06 0:47 
QuestionHow can I let DCOM server be visited through internet? Pin
johnsonwen11-Nov-06 22:13
johnsonwen11-Nov-06 22:13 
QuestionBSTR thru COM does not seem to be passed..... Pin
morenz10-Nov-06 9:17
morenz10-Nov-06 9:17 
QuestionRe: BSTR thru COM does not seem to be passed..... [modified] Pin
prasad_som13-Nov-06 22:08
prasad_som13-Nov-06 22:08 
AnswerRe: BSTR thru COM does not seem to be passed..... Pin
morenz21-Nov-06 5:37
morenz21-Nov-06 5:37 
Question.net addin outlook Pin
K edar V10-Nov-06 0:39
K edar V10-Nov-06 0:39 
QuestionCOM Inheritance Pin
Inactive Cargo9-Nov-06 23:37
Inactive Cargo9-Nov-06 23:37 
Hello,

I can't figure out how to derive a class from an interface with pure functions side by side a class that implements those functions and use those functions in place of the pure ones. That is:


interface BaseInterface : public IUnknown 
{ 
        // BaseInterface 



}; 


interface DerivedInterface : public BaseInterface 
{ 
        // DerivedInterface 
        STDMETHOD_( INT, AddNumbers )( INT LHS, INT RHS ) PURE; 


}; 


class BaseInterfaceImpl : public BaseInterface 
{ 
        // IUnknown 
        STDMETHOD_( ULONG, AddRef )() 
        { 
                return S_OK; 
        } 

        STDMETHOD_( ULONG, Release )() 
        { 
                return S_OK; 
        } 


        STDMETHOD( QueryInterface )( REFIID RefIID, LPVOID *ppObject ) 
        { 
                return S_OK; 
        } 



}; 


class DerivedInterfaceImpl : public DerivedInterface, public BaseInterfaceImpl 
{ 
public: 
        // DerivedInterfaceImpl 
        STDMETHOD_( INT, AddNumbers )( INT LHS, INT RHS ) 
        { 
                return LHS + RHS; 
        } 

        // TestInstance should have AddRef, Release and QueryInterface 



}; 



MSVC gives me the error:

c:\documents and settings\todd\my documents\visual studio 
2005\projects\whitehall\toying with c++\toying.cpp(72) : error C2259: 
'DerivedInterfaceImpl' : cannot instantiate abstract class 
        due to following members: 
        'HRESULT IUnknown::QueryInterface(const IID &,void **)' : is 
abstract 
        d:\program files\microsoft visual studio 
8\vc\platformsdk\include\unknwn.h(113) : see declaration of 
'IUnknown::QueryInterface' 
        'ULONG IUnknown::AddRef(void)' : is abstract 
        d:\program files\microsoft visual studio 
8\vc\platformsdk\include\unknwn.h(117) : see declaration of 
'IUnknown::AddRef' 
        'ULONG IUnknown::Release(void)' : is abstract 
        d:\program files\microsoft visual studio 
8\vc\platformsdk\include\unknwn.h(119) : see declaration of 
'IUnknown::Release'



I've got the source code of my dummy-test scenario at
http://lanlocked.net/junk/toying.cpp. I managed to get it to work by
deriving DerivedInterface from BaseInterfaceImpl but I don't see this
as a solution, rather a workaround (I'd like to keep the interfaces
"clean" and 100% pure). If it's impossible to do what I'm trying to do,
what are the other methods of inheriting in COM?


Thanks in advance,
Todd
AnswerRe: COM Inheritance Pin
prasad_som10-Nov-06 1:13
prasad_som10-Nov-06 1:13 
QuestionUsing COM crreated by MatLab Pin
Dhanushka P9-Nov-06 1:04
Dhanushka P9-Nov-06 1:04 
QuestionInstalling Certificates in IE Pin
Subrahmanyam K9-Nov-06 0:43
Subrahmanyam K9-Nov-06 0:43 
Questionadding dll in C#? Pin
barak1604879-Nov-06 0:02
barak1604879-Nov-06 0:02 
Questionhi guys Pin
amanboy68-Nov-06 21:35
amanboy68-Nov-06 21:35 
Questionshell drag and drop between namespace extension and windows Pin
sathink8-Nov-06 5:05
sathink8-Nov-06 5:05 
QuestionUsing Interface type from the imported TLB (Attributed COM) Pin
arun14058-Nov-06 0:50
arun14058-Nov-06 0:50 
QuestionWindows Server clustering using WMI Pin
abhiramsss7-Nov-06 14:24
abhiramsss7-Nov-06 14:24 
QuestionVery Urgent : How to list all the registered assesmblies Pin
kamal k s chauhan6-Nov-06 22:18
kamal k s chauhan6-Nov-06 22:18 
AnswerRe: Very Urgent : How to list all the registered assesmblies Pin
Jonathan [Darka]8-Nov-06 0:33
professionalJonathan [Darka]8-Nov-06 0:33 
QuestionHow to list all the registered assesmblies Pin
kamal k s chauhan6-Nov-06 22:17
kamal k s chauhan6-Nov-06 22:17 
QuestionCOM+ help me Pin
AnhTin6-Nov-06 16:47
AnhTin6-Nov-06 16:47 
QuestionTwo questions on COM Add-in for Outlook Pin
OctopusThu6-Nov-06 6:47
OctopusThu6-Nov-06 6:47 
AnswerRe: Two questions on COM Add-in for Outlook Pin
OctopusThu6-Nov-06 15:39
OctopusThu6-Nov-06 15:39 
QuestionRe: Two questions on COM Add-in for Outlook Pin
prasad_som6-Nov-06 18:54
prasad_som6-Nov-06 18:54 
GeneralRe: Two questions on COM Add-in for Outlook Pin
OctopusThu6-Nov-06 19:51
OctopusThu6-Nov-06 19:51 
AnswerRe: Two questions on COM Add-in for Outlook Pin
prasad_som6-Nov-06 19:57
prasad_som6-Nov-06 19:57 

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.