Gets a reference to a global item, such as the host-provided application object.
[Visual Basic] Function GetGlobalInstance( _ ByVal name As String _ ) As Object [C#] object GetGlobalInstance( string name ); [C++] Object* GetGlobalInstance( String* name ); [JScript] function GetGlobalInstance( name : String ) : Object;
- The specified name of the global object to retrieve.
Returns a reference to the global object.
Exposing global objects in Script for the .NET Framework is a relatively simple process.
- The host adds global items to the engine by creating an IVsaGlobalItem object, specifying the name and type of the global object.
- With this information, the engine is able to compile the code items to bind against the global object.
- When the host calls the IVsaEngine.Run method, the engine calls back on the IVsaSite.GetGlobalInstance method to pull a host-provided instance of the named global item into the script engine.
The following table shows the exceptions that the GetGlobalInstance method can throw.
|GlobalInstanceInvalid||The named global instance does not exist.|
|CallbackUnexpected||The host was not expecting a call at this time.|
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family