dcsimg
How do i get a VB6 form to handle events from a Java Bean converted into an ActiveX control using the ActiveX bridge
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Babu_Madhikarmi
Posted On:   Sunday, February 13, 2005 08:56 AM

Can anyone help me here? I've been looking at the O'reilly Java Beans book and following it very closely. I have modelled my bean on the three classes used in his example in chapter 8 folder http://examples.oreilly.com/javabeans/Samples.zip realising i need the add, remove listeners, a listener class and an event class. the obejcts from the O'reilly book i have followed are TemperaturePulseEvent, TemperaturePulseListener (VisualTemperature) and TempModifier(Boiler)... the boiler being the source of the event. My source object (MyBean) has an integer property called command. I have getters and setters for it. I have addCommandReceivedListener and removeCommandReceivedListener. The add one is unicast ie it only allows one listener   More>>

Can anyone help me here?
I've been looking at the O'reilly Java Beans book and following it very closely. I have modelled my bean on the three classes used in his example in chapter 8 folder
http://examples.oreilly.com/javabeans/Samples.zip
realising i need the add, remove listeners, a listener class and an event class. the obejcts from the O'reilly book i have followed are TemperaturePulseEvent, TemperaturePulseListener (VisualTemperature) and TempModifier(Boiler)... the boiler being the source of the event.

My source object (MyBean) has an integer property called command. I have getters and setters for it. I have addCommandReceivedListener and removeCommandReceivedListener. The add one is unicast ie it only allows one listener to be added to the object. I also have a method called notifyListener() that calls a listeners event handling method to handle CommandReceivedEvents. This notifyListener method is called once the setCommand Method is called (ie when the value is changed) and the event created and passed to the listener stores the value of command in own variable.

the listener doesnt really do much except receive the event and retrieve the command value. Both MyBean and CommandReceivedListener objects are Java Beans and the event object is not a bean in my Manifest file.

OK now the problem.... packaged the three objects into a jar, and generated two dlls from the same jar file (MyBean and CommandReceivedListener).
I embeded these components into a VB form which works great... except that VB is not finding any events from the MyBean object... I understand in Visual Studio VB6 you select the component from the top left drop down box and on the right drop down box you should find your event.... but it's just not there!

I know VB form has registered itself as a listener to MyBean because I cannot addCommandReceivedListener to listen to MyBean (throws a TooManyListenersException ie there is already one)

can someone please advise me what is going on and how i can get my VB form to handle my custom CommandReceivedEvent given by MyBean... just like O'reilly did with tempPulseEvents....

thank you

   <<Less
About | Sitemap | Contact