Export (0) Print
Expand All

HttpServerUtility.CreateObjectFromClsid Method

Creates a server instance of a COM object identified by the object's class identifier (CLSID).

[Visual Basic]
Public Function CreateObjectFromClsid( _
   ByVal clsid As String _
) As Object
[C#]
public object CreateObjectFromClsid(
 string clsid
);
[C++]
public: Object* CreateObjectFromClsid(
 String* clsid
);
[JScript]
public function CreateObjectFromClsid(
   clsid : String
) : Object;

Parameters

clsid
The class identifier of the object to be instantiated.

Return Value

The new object.

Exceptions

Exception Type Condition
HttpException The object could not be instantiated.

Example

[Visual Basic] 
Dim ClsidStr As String
Dim MyObject As Object
 
ClsidStr = "42754580-16b7-11ce-80eb-00aa003d7352"
MyObject = Server.CreateObject(ClsidStr)
   

[C#] 
String ClsidStr;
Object MyObject;

ClsidStr = "42754580-16b7-11ce-80eb-00aa003d7352";
MyObject = Server.CreateObject(ClsidStr);
   

[C++] 
String* ClsidStr;
Object* MyObject;

ClsidStr = S"42754580-16b7-11ce-80eb-00aa003d7352";
MyObject = Server->CreateObject(ClsidStr);
   

[JScript] 
var clsidStr : String
var myObject : Object
 
clsidStr = "42754580-16b7-11ce-80eb-00aa003d7352"
myObject = Server.CreateObject(clsidStr)
   

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpServerUtility Class | HttpServerUtility Members | System.Web Namespace

Show:
© 2014 Microsoft