Re: Methods overloading?



COM does not support overloading; instead, it supports encapsulation. So what you need to
do is create a new ActiveX control that embeds the one you want, and call its methods. It
is then free to do whatever it wants to translate to the contained control. ActiveX
controls can nest.

There is a strong set of debates as to whether encapsulation or inheritance is a better
methodology. I tend to favor encapsulation, as an idea, but it is so complex to implement
in ActiveX that I have avoided it. It solves a lot of inheritance-related problems, such
as do you call the superclass before, after, or in the middle of, whatever you are doing
to implement the overload?

[True story: I woke up after two major surgeries in 36 hours, the second to correct
problems caused by the first. In the haze of post-surgical anaesthesia hangover, massive
amounts of morphine being injected into me, loss of over half my blood due to internal
hemorrhaging, and unbelievable pain, I realized I had a nasogastric tube up my nose
keeping my stomach drained, and another tube keeping my bladder drained. One thought
sprang crystal-clear into my mind: "Good grief! My input/output methods have been
subclassed!". This was reassuring, because I realized that given such an insight, I had
probably not suffered any brain damage from the blood loss. But for the next 24
hours--and I blame this entirely on the drugs--I was in a panic because I couldn't
remember if I had to call the superclass Stomach::Swallow before or after I swallowed...]
joe

On Thu, 9 Feb 2006 10:58:51 +0100, "Mittik" <accia77@xxxxxxxxxxx> wrote:

Hi,
i'm writing an activex control with MS VC++ 6.0,capable of drawing a certain
number of graphs (max 5 graphs),which i want the user to choose.
I would like to insert the data to be drawn with an InsertData method,but
i've discovered with a little disappoint that i can't overload activex
methods:indeed i would like the control to call the appropriate InsertData
function depending on the number of quantities chosen,and i had thought of
writing 5 different versions of the InsertData method,but,as already said,it
isn't possible.
Can you give me some advice?

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • ActiveX problem
    ... Everytime I start Excel it asks me if I want to run this Active X control. ... how ActiveX controls are initialized within Office applications. ... another format the link reference to the ActiveX control might not convert ...
    (microsoft.public.windowsxp.perform_maintain)
  • RE: ActiveX as a Service with events
    ... > Have an ActiveX created in Delphi 7 and need to run it in a service by ... > If I just add the reference to the control at design time using the TLBImp ... > Private WithEvents myOCX as AxmyControl.AxmyOCX ... > Private Sub OnStart() ...
    (microsoft.public.dotnet.framework.interop)
  • Re: User Controls (Active X) - Da Process
    ... ActiveX control itself. ... Interfaces), defined in other Binaries. ...
    (microsoft.public.vb.general.discussion)
  • RE: Microsoft Baseline Security Analyzer exploit (Exposed vulnerabilities list)
    ... >security setting of the browser. ... >whether to launch ActiveX that is signed by a specific signer. ... There IS a need for low security for the rouge ActiveX control to be ... Admin downloads and runs MBSA. ...
    (Vuln-Dev)
  • Re: System.Timers.Timer() sometimes gets stuck and disappears??
    ... The activeX was blocking ... with a timeout function. ... I think that this is getting stuck at the activeX control. ... | int myValue = activeXControl1.getMyValue; ...
    (microsoft.public.dotnet.languages.csharp)

Quantcast