Re: Event question

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hi Johann,

thanks for answering!

I (at leas I am not aware of...) don't override the event.
In the base class (which is abstract) I declared the abstract method:
public abstract void MsgSent();
My intention is that every derived class must implement this mehtod.
The purpose of this method is to call all assigned delegates - OnMsgSent -
declared as event handles as previously shown.

Regards
Rainer

"Johann Blake" <johannblake@xxxxxxxxx> schrieb im Newsbeitrag
news:1121691122.674236.4660@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I don't believe that you can override an event. Since OnMsgSent is
> defined as an even using:
>
> public event EventHandler OnMsgSent;
>
> it must always be defined in this manner. You cannot create a *method*
> called OnMsgSent. A method and an event are two different things.
>
> What exactly do you want to accomplish?
>
> Best Regards
> Johann Blake
>


.



Relevant Pages

  • Re: Simple method declaration question...
    ... Regards ... Michael ... > will act to override the base class version when used polymorphically ...
    (comp.lang.java.help)
  • Re: What can I store in LPARAM
    ... I'm not saying you're wrong, but with my call back up to the base class, ... may choose to override it completely, or by adding code before or after ... comments below regarding leaf. ... This means that a subclass can't change the method body behind ...
    (microsoft.public.vc.mfc)
  • Re: How many bytes per Italian character?
    ... override the InitState() function so it needs to be pure virtual. ... derived classes call up to them anyway; ... both the base class and derived class. ...
    (microsoft.public.vc.mfc)
  • Re: Overriding "OnXXX" versus adding event handler
    ... to touch base functionality and not to deal with component ... Either for base class or for my class. ... For example, you can either write a new OnPaint override, or you can ... In other words, override when you can, add an event handler if you can't. ...
    (microsoft.public.dotnet.framework)
  • Re: problem deriving class from ostringstream (operator <<)
    ... base class Logger. ... >the following sample code writes the 1st string to both cout as well as the ... not override: ... You shouldn't use these old headers which are there ...
    (comp.lang.cpp)