ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript
ScriptEngine Class
ScriptEngine Methods
AddCOMObject Method
AddCOMObject(String, Guid) Method
AddCOMObject(String, String) Method
AddCOMObject(String, HostItemFlags, Guid) Method
AddCOMObject(String, HostItemFlags, String) Method
AddCOMObject(String, Guid, String) Method
AddCOMObject(String, String, String) Method
AddCOMObject(String, HostItemFlags, Guid, String) Method
AddCOMObject(String, HostItemFlags, String, String) Method

# ScriptEngineAddCOMObject(String, HostItemFlags, Guid, String) Method

Creates a COM/ActiveX object on the specified server and exposes it to script code with the specified options. The registered class is specified by class identifier (CLSID).
Namespace: Microsoft.ClearScript
Assembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.5.0
Syntax
C#
VB
C++
F#
Copy

    public void AddCOMObject(
    	string itemName,
    	HostItemFlags flags,
    	Guid clsid,
    	string serverName
    )

    Public Sub AddCOMObject (
    	itemName As String,
    	flags As HostItemFlags,
    	clsid As Guid,
    	serverName As String
    )

    public:
    virtual void AddCOMObject(
    	String^ itemName,
    	HostItemFlags flags,
    	Guid clsid,
    	String^ serverName
    ) sealed

    abstract AddCOMObject :
            itemName : string *
            flags : HostItemFlags *
            clsid : Guid *
            serverName : string -> unit
    override AddCOMObject :
            itemName : string *
            flags : HostItemFlags *
            clsid : Guid *
            serverName : string -> unit

#### Parameters

itemName String
  A name for the new global script item that will represent the object.
flags HostItemFlags
  A value that selects options for the operation.
clsid Guid
  The class identifier (CLSID) of the registered class to instantiate.
serverName String
  The name of the server on which to create the object.

#### Implements

IScriptEngineAddCOMObject(String, HostItemFlags, Guid, String)
Remarks
For information about the mapping between host members and script-callable properties and methods, see AddHostObject(String, HostItemFlags, Object).
See Also

#### Reference

ScriptEngine Class
AddCOMObject Overload
Microsoft.ClearScript Namespace

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft