ActiveX events [message #40102] |
Thu, 22 July 2004 15:37 |
b_gom
Messages: 105 Registered: April 2003
|
Senior Member |
|
|
I'm trying to use some 3rd party ActiveX components from within IDL,
and I'm having some trouble with handling events. The vendor only
supplies Visual Basic examples, so I'm hoping someone can help
interpret them in an IDL context.
Here's the main part of the Visual Basic Example. The form has an
A32Event object placed on it named A32Event1.
------------------
lRc = A32Event1.StartEvent � Enable the event
If(lRc <> aerNoErr ) Then � If error starting the event
MsgBox( A32Control1.ErrorMessage ( lRc )) � display the error
message
End If
Private Sub A32Event1_AxisEvent()
MsgBox " An axis fault has occurred !"
End Sub
Private Sub Form_Unload(Cancel As Integer)
A32Event1.StopEvent ' Disable the Event on program exit !
End Sub
------------------
Here's the IDL version:
------------------
A32event_widget = widget_activex(tlb,
'{4D53B793-1B0F-11D6-A2CF-0001022E1B44}', EVENT_PRO='wid_event',
xsize = 1, ysize = 1, uval='A32event')
WIDGET_CONTROL, A32event_widget, get_value=A32Event
...
result = A32Event ->StartEvent() ; Enable the event
------------------
When I call the StartEvent method, the object returns an internal
error code of: "The Callback Event is invalid", and I never get any
widget events. Any ideas how I could debug this problem, since the
vendor claims it is an IDL problem? How does IDL translate ActiveX
events into widget events? How do I know if IDL is not translating the
events properly?
Has anyone had troubles with ActiveX events?
Thanks
Brad Gom
|
|
|