473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Event Handling in VB.Net + Late Binding

I Created Object A in the Object B. then I called a function of object
A from object B…
Like..

Public Class A

Public Event beforeSample()

Public Sub function_Sample()

RaiseEvent beforeSample()

‘’’’’’
‘’’’’’
‘’’’’’
End Function

End Class

Public Class B

Private WithEvents obj as new A

Private Function Main() as Boolean
‘’’’’’
‘’’’’
‘’’’’
‘’’’’
Obj. function_Sample()
‘’’’’
‘’’’’
‘’’’’
‘’’’’
End function
Private Sub obj_beforeSample() handle Obj.beforeSample

End Sub

End Class

So here I handle the event beforeSample in the Object B….!

The Problem is… How do I handle the events, if I create the object in
late bind method ?

means…

Public Class B

Private obj as Object

Private Function Main() as Boolean

‘’’’’’
‘’’’’’
‘’’’’’
obj = new A ‘late bind method

‘’’’’’
‘’’’’’
‘’’’’’
Obj. function_Sample()

End Function

End Class

Then How to handle the events of Object A ??

*** Sent via Developersdex http://www.developersdex.com ***
Jul 27 '06 #1
1 3672
Hi,

Use AddHandler
http://msdn2.microsoft.com/en-us/library/6yyk8z93.aspx

Ken
----------------------
"Elankathir S.N." <sn**********@hotmail.comwrote in message
news:Oy**************@TK2MSFTNGP05.phx.gbl...
>I Created Object A in the Object B. then I called a function of object
A from object B.
Like..

Public Class A

Public Event beforeSample()

Public Sub function_Sample()

RaiseEvent beforeSample()

''''''
''''''
''''''
End Function

End Class

Public Class B

Private WithEvents obj as new A

Private Function Main() as Boolean
''''''
'''''
'''''
'''''
Obj. function_Sample()
'''''
'''''
'''''
'''''
End function
Private Sub obj_beforeSample() handle Obj.beforeSample

End Sub

End Class

So here I handle the event beforeSample in the Object B..!

The Problem is. How do I handle the events, if I create the object in
late bind method ?

means.

Public Class B

Private obj as Object

Private Function Main() as Boolean

''''''
''''''
''''''
obj = new A 'late bind method

''''''
''''''
''''''
Obj. function_Sample()

End Function

End Class

Then How to handle the events of Object A ??

*** Sent via Developersdex http://www.developersdex.com ***

Jul 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Zlatko Matiζ | last post by:
I was reading about late binding, but I'm not completely sure what is to be done in order to adjust code to late binding... For example, I'm not sure if this is correct: early binding: Dim ws...
30
by: lgbjr | last post by:
hi All, I've decided to use Options Strict ON in one of my apps and now I'm trying to fix a late binding issue. I have 5 integer arrays: dim IA1(500), IA2(500), IA3(500), IA4(500), IA5(500) as...
0
by: Elan | last post by:
I Created Object A in the Object B. then I called a object A function from object B... Like.. Public Class A Public Event beforeSample() Public Sub function_Sample()
0
by: swellfr | last post by:
Hi, I have a component that i can only access through late binding. This is working fine , i can use all the exposed methods , but i can't register (/don't know how to ) event handlers for this...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shζllξpτpο 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.