Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capturing Custom ActiveX Events in VBScript

Status
Not open for further replies.

bitwise

Programmer
Mar 15, 2001
269
US
Lets say you embedded an ActiveX control in a webpage with the <OBJECT> tag. Lets say you also give the ActiveX control an id. Now you can call ActiveX methods in VBScript code simply by going:

ObjectID.MyFunction(...)

My question is how can you capture a custom event? I have an ActiveX control that displays a tree control. It has a custom event when the tree control changes it's selection something like OnSelectionChanged. How can I write a VBScript handler so I know when the tree controls selection changes on the webpage? When placing this control in a regular dialog or form the event is exposed in VB or VC++, but I cannot seem to get at it from a webpage.

Thanks,
bitwise
 
To responde to any event just put

Sub ObjectID_EventName(ByVal ListYourVariables)
.......
.......
End Sub

Examples

Consider that my ObjectID = GVAPI


Sub GVAPI_OnNewData(ByVal strData)
Msgbox(&quot;OnNewData Event&quot;)
End Sub

Sub GVAPI_OnServerConnect()
Msgbox(&quot;OnServerConnect Event&quot;)
End Sub

Sub GVAPI_OnServerDisconnect()
Msgbox(&quot;OnServerDisconnect Event&quot;)
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top