SCRIPTSTATE Enumeration

Specifies the state of a scripting engine. This enumeration is used by the IActiveScript::GetScriptState , IActiveScript::SetScriptState , and IActiveScriptSite::OnStateChange methods.

Syntax

typedef enum tagSCRIPTSTATE {  
    SCRIPTSTATE_UNINITIALIZED = 0,  
    SCRIPTSTATE_INITIALIZED   = 5,  
    SCRIPTSTATE_STARTED       = 1,  
    SCRIPTSTATE_CONNECTED     = 2,  
    SCRIPTSTATE_DISCONNECTED  = 3,  
    SCRIPTSTATE_CLOSED        = 4  
} SCRIPTSTATE;  

Enumeration Values

SCRIPTSTATE_UNINITIALIZED Script has just been created, but has not yet been initialized using an IPersist* interface and IActiveScript::SetScriptSite .
SCRIPTSTATE_INITIALIZED Script has been initialized, but is not running (connecting to other objects or sinking events) or executing any code. Code can be queried for execution by calling the IActiveScriptParse::ParseScriptText method.
SCRIPTSTATE_STARTED Script can execute code, but is not yet sinking the events of objects added by the IActiveScript::AddNamedItem method.
SCRIPTSTATE_CONNECTED Script is loaded and connected for sinking events.
SCRIPTSTATE_DISCONNECTED Script is loaded and has a run-time execution state, but is temporarily disconnected from sinking events.
SCRIPTSTATE_CLOSED Script has been closed. The scripting engine no longer works and returns errors for most methods.

See Also

Active Script Constants, Enumerations, and Error Codes