Re: How can I implement IOleCommandTarget?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Kim Gräsman (kim_at_mvps.org)
Date: 09/29/04


Date: Wed, 29 Sep 2004 20:46:07 +0200

Igor, et al,

> > You need STDMETHOD() in the header, STDMETHODIMP
> > goes in the CPP file.
>
> STDMETHODIMP happily works in both places. You only need STDMETHOD when
> defining your own interface. The only difference between the two is that
> STDMETHOD adds "virtual" in front, which is needed when you define a
> method but not when you override one from the base class.

Yeah, I guess ATL-style Impl-classes need STDMETHOD, since they are derived
from, and their methods can be overridden. I always use STDMETHODIMP as
well, since most of what I write is at the bottom of the inheritance chain
(barring CComObject).

Might be worth to keep in mind, though, that if you're building a class to
be derived from, STDMETHOD is the better choice (unless I've misunderstood
the state of affairs).

-- 
Best regards,
Kim Gräsman 


Relevant Pages

  • Re: CheckBox control and IPostBackDataHandler
    ... Try it without IPostBackDataHandler at the top of the class. ... The base class already implements it so you should not have to re-declare ... > With or without the use of the keyword override it does not work. ... > (as the base class implements the interface). ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Confuesd about abstract class vs interface
    ... descendentants cannot be instantiated unless they override *all* abstract ... abstract class A: Foo ... > In short as I understand it, an interface is like a contract between> the class and the interface, so that certain funtions must be> implemented. ... So if you have a class which inherits base class that> inherts an interface, then your classes will have a standard. ...
    (microsoft.public.dotnet.languages.csharp)
  • I dont understand inheritance!
    ... The class that I try to override is: ... IPostBackDataHandler (notice the interface that is implemented) ... /* here i cannot override this method that the base class implements (as ...
    (microsoft.public.dotnet.languages.csharp)
  • I dont understand inheritance!
    ... The class that I try to override is: ... IPostBackDataHandler (notice the interface that is implemented) ... /* here i cannot override this method that the base class implements (as ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: I dont understand inheritance!
    ... Look up explicit interface implementation to answer the majority of your ... which your subclasses can override. ... > //this does not compile, compiler says: ... > /* here i cannot override this method that the base class implements ...
    (microsoft.public.dotnet.framework.aspnet)