IServer::CreateObject

The IServer::CreateObject method creates an instance of a server component. For more information, see the CreateObject method of the Server object.

HRESULT CreateObject(

  BSTR bstrProgID// contains the progID of the component

  IDispatch ** ppDispObject

        //pointer to an IDispatch interface pointer

);

 

Parameters
bstrProgID
[in] A BSTR that contains the progID of the object.
ppDispObject
[retval] [out] Points to an IDispatch interface pointer.
Remarks

By default, objects created by the Server.CreateObject method have page scope. This means that they are automatically destroyed by the server when it finishes processing the current ASP page.

To create an object with session or application scope, you can either use the <OBJECT> tag and set the SCOPE attribute to SESSION or APPLICATION, or store the object in a session or application variable.

See Also

Server Object