CreateObjectFromClsid Method

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
public object CreateObjectFromClsid(
 string clsid
public: Object* CreateObjectFromClsid(
 String* clsid
public function CreateObjectFromClsid(
   clsid : String
) : Object;


The class identifier of the object to be instantiated.

Return Value

The new object.


Exception Type Condition
HttpException The object could not be instantiated.


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

String ClsidStr;
Object MyObject;

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

String* ClsidStr;
Object* MyObject;

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

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


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

See Also

HttpServerUtility Class | HttpServerUtility Members | System.Web Namespace

© 2016 Microsoft