Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 8th, 2004, 03:40 PM
Registered User
 
Join Date: Oct 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default late binding, how to I create an event handler?

Hello,

With late binding, how to I create an event handler? Note this is all VB.NET, even the assembly.class that I'm trying to late bind.

Code example:

Dim objDll As [Assembly]

objDll = [Assembly].LoadFrom("D:\My Documents\myassembly.dll")

Dim myType As Type = objDll.GetType("myassembly.myclass")

Dim obj As Object
obj = Activator.CreateInstance(mytype)

'now how do I achieve the following?
'myclass has an event called 'Helloworld'

' this does not work as obj has no
' event named helloworld???
addhandler obj.Helloworld, addressof me.myclassHelloworld

sub myclasshelloworld()
'code...
end sub





Thanks,

Glenn


 
Old November 15th, 2004, 09:40 PM
Registered User
 
Join Date: Nov 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did you resolve your problem?

I have the same question.

How can I create an event handler while using late binding?

Can you help me?

Thanks.

MFM
 
Old November 16th, 2004, 02:22 AM
Authorized User
 
Join Date: Jun 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Dhodie
Default

You can try the OLE callbacks. It provides two way communication
between server and client.

If you want i will give you code example.

-Dhodie

 
Old November 16th, 2004, 02:33 AM
Registered User
 
Join Date: Nov 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Dhodie

Yes please, I will appreciate your sample code.

[email protected]

Thanks.






Similar Threads
Thread Thread Starter Forum Replies Last Post
late binding,help? alexcym Visual Basic 2005 Basics 2 April 7th, 2008 03:26 PM
late binding, how to I create an event handler? grom Pro VB.NET 2002/2003 0 October 8th, 2004 03:42 PM
User controls and event handler binding perropicante ASP.NET 1.0 and 1.1 Professional 1 December 18th, 2003 10:52 AM
Late Binding Blade XML 3 July 17th, 2003 06:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.