System.Win.ComObj.CreateRemoteComObject

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function CreateRemoteComObject(const MachineName: WideString; const ClassID: TGUID): IUnknown;

C++

extern DELPHI_PACKAGE System::_di_IInterface __fastcall CreateRemoteComObject(const System::WideString MachineName, const GUID &ClassID);

Properties

Type Visibility Source Unit Parent
function public
System.Win.ComObj.pas
System.Win.ComObj.hpp
System.Win.ComObj System.Win.ComObj

Description

Creates a Com object on another machine and returns an IUnknown interface for it.

Use CreateRemoteComObject to create an object on a remote server. CreateRemoteComObject creates a single uninitialized object of the class associated with the CLSID specified by the ClassID parameter. The MachineName parameter specifies the machine that lists the ClassID in its type library.

Usually, MachineName is the UNC name of the machine, which can be obtained by looking up its Machine Name under the Network settings in the Windows control panel. However, under some configurations of COM, MachineName is the IP address or Host name of the remote system.

CreateRemoteComObject returns a reference to the IUnknown interface for the object. Use this interface to obtain information about other interfaces supported by the object.

Tip: If the interface returned by CreateRemoteComObject is assigned to a Variant, you can release the interface by assigning the Unassigned constant to that Variant.

See Also