Home All Groups Group Topic Archive Search About

How to overload method of third party component?

Author
15 Apr 2005 6:28 PM
Brett
I have this sub, which is part of a third party component:

Private Sub Uploader1_OnProcessCompleted(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Uploader1.OnProcessCompleted

--do something

End Sub

I need to pass in another parameter.  I do have access to their source code
but only need the modification for one app.  In other words, I don't want to
create a new parameter that must be used by all apps.  I just need to
overload for this one app.  How is that done?

Thanks,
Brett

Author
16 Apr 2005 5:51 AM
Adam Goossens
Hi Brett,

You can't pass another parameter to that because it's an event handler.
You could override the function which fires the event and change the
event it fires, but this will likely break a lot of code.

Where do you get the parameter from? There's probably another way to do
what you require.

Regards,
-Adam.

Brett wrote:
Show quoteHide quote
> I have this sub, which is part of a third party component:
>
> Private Sub Uploader1_OnProcessCompleted(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Uploader1.OnProcessCompleted
>
> --do something
>
> End Sub
>
> I need to pass in another parameter.  I do have access to their source code
> but only need the modification for one app.  In other words, I don't want to
> create a new parameter that must be used by all apps.  I just need to
> overload for this one app.  How is that done?
>
> Thanks,
> Brett
>
>
Author
16 Apr 2005 1:02 PM
Brett
The process starts in a button click event.

SubmitForm(me.mcsomeclass)

The above sub is where the parameter comes from.  In that sub, I do this:

    Private Sub SubmitForm(ByVal mailClientRef As IWebmailclients.Iwebmail)

            Me.Uploader1.url = mailClientRef.LoginFormURL

The Uploader1 component has an onComplete event:

    Private Sub Uploader1_OnStatusChanged(ByVal sender As System.Object,
ByVal e As X5.IUploaderEvents_OnStatusChangedEvent)

The above is where I need to pass in the Interface that was passed to
SubmitForm().

Thanks,
Brett

Show quoteHide quote
"Adam Goossens" <adam.gooss***@gmail.com> wrote in message
news:efUKUhkQFHA.1500@TK2MSFTNGP09.phx.gbl...
> Hi Brett,
>
> You can't pass another parameter to that because it's an event handler.
> You could override the function which fires the event and change the event
> it fires, but this will likely break a lot of code.
>
> Where do you get the parameter from? There's probably another way to do
> what you require.
>
> Regards,
> -Adam.
>
> Brett wrote:
>> I have this sub, which is part of a third party component:
>>
>> Private Sub Uploader1_OnProcessCompleted(ByVal sender As Object, ByVal e
>> As System.EventArgs) Handles Uploader1.OnProcessCompleted
>>
>> --do something
>>
>> End Sub
>>
>> I need to pass in another parameter.  I do have access to their source
>> code but only need the modification for one app.  In other words, I don't
>> want to create a new parameter that must be used by all apps.  I just
>> need to overload for this one app.  How is that done?
>>
>> Thanks,
>> Brett
Author
16 Apr 2005 8:07 AM
Cor Ligthert
Brett,

When it is not yet there you can set it in that code as a complete new
method with the same name.

That is named an overloaded method.

I hope this helps,

Cor
Author
16 Apr 2005 12:57 PM
Brett
"Cor Ligthert" <notmyfirstn***@planet.nl> wrote in message
news:e5Z9mtlQFHA.3544@TK2MSFTNGP12.phx.gbl...
> Brett,
>
> When it is not yet there you can set it in that code as a complete new
> method with the same name.

What do you mean here?  Can you show an example?

Show quoteHide quote
>
> That is named an overloaded method.
>
> I hope this helps,
>
> Cor
>