Your Ad Here

Registering (Binding) Events in XSI

Binding Events

Before events can be trapped by event handlers, clients must register for events. Registering for an event requires the client to provide information about the event to sink and the function required for handling that event.

 

Custom commands also need to be specified to XSI before they can be used in the application.

You must explicitly bind the event to the event handler. That means that you need to use the XSIApplication.Advise method to register for events.

 

You cannot use JScript to bind an event in XSI; however, you can write your event handler in JScript and use VBScript to bind it to the event.

 

For more information on the specifics of how to use the XSIApplication.Advise method, see Methods in the Programmers Reference section of the Scripting Reference guide.

Example: binding a C++ handler function

Since XSI expects clients to export the XSIOnEvent entry point, the name of the C++ handler is not required:

' Use some variables in place of arguments
ename = "OnEndSceneOpen"
file = "C:\MyEventHandler.dll"
lang = "cpp"
name = "MyEvent1"
XSIApplication.Advise ename, file, ,lang , name



 

Return to Softimage XSI Index


Your Ad Here