HttpServerUtility.CreateObjectFromClsid(String) HttpServerUtility.CreateObjectFromClsid(String) HttpServerUtility.CreateObjectFromClsid(String) HttpServerUtility.CreateObjectFromClsid(String) Method

定義

建立以物件的類別識別項 (CLSID) 識別的 COM 物件的伺服器執行個體。Creates a server instance of a COM object identified by the object's class identifier (CLSID).

public:
 System::Object ^ CreateObjectFromClsid(System::String ^ clsid);
public object CreateObjectFromClsid (string clsid);
member this.CreateObjectFromClsid : string -> obj
Public Function CreateObjectFromClsid (clsid As String) As Object

參數

clsid
String String String String

要建立執行個體之物件的類別識別項。The class identifier of the object to create an instance of.

傳回

新物件。The new object.

例外狀況

無法建立物件的執行個體。An instance of the object could not be created.

範例

下列範例示範如何使用CreateObjectFromClsid方法用來建立 COM 物件的伺服器執行個體。The following example demonstrates how to use the CreateObjectFromClsid method to create a server instance of a COM object.

String ClsidStr;
Object MyObject;

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

適用於

另請參閱