GetObject Function

Syntax

GetObject([File$][, Class$]

Group

Object

Description

Obtains an existing object of type Class$ from File$. Use Set to assign the returned object to an object variable.

Pocket PC

Not supported.

Sandbox

Sandbox mode blocks this function.

Parameters

Parameters Description
File$ The file where the object resides. If this is omitted, the currently active object for Class$ is returned.
Class$ The application registered class name. If this application is not currently active, it is started. If this is omitted, the application associated with the file extension is started.

Example


Sub Main
    Dim App As Object
    Set App = GetObject(,"WinWrap.CppDemoApplication")
    App.Move 20,30 ' move icon to 20,30
    Set App = Nothing
    App.Quit       ' run-time error (no object)
End Sub