|
APGScript Object |
|
See Also: |
The CreateObject() method creates a COM object, and optionally activates script handling of its events.
VBScript:
JScript:
| oAPGScript | An APGScript object. |
| strProgID | The PROGID of the component being created. |
| strHandlerPrefix | Optional. Call script functions named strHandlerPrefix + EventName when this object fires events. |
| oObject | The created COM object. |
Provides external access to Script.CreateObject(). See the Script.CreateObject() topic for more information.
If the parameter strHandlerPrefix is specified, APGen connects to the object's default outgoing interface after creating the object. When the object fires an event, APGen calls a script subroutine (inside oAPGScript ) named strHandlerPrefix plus the event name. Note that APGScript.CreateObject() hooks up event handler procedures inside the oAPGScript script code to events raised by oObject. If oAPGScript has not yet been run, none of the procedures within the script are available, so they will not be called when oObject fires events.
If strHandlerPrefix is used, use APGScript.DisconnectEvents() to disable script event handling for the object.