Показать сообщение отдельно
Старый 02.12.2002, 10:37   #2  
Wamr is offline
Wamr
----------------
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
 
1,737 / 858 (32) +++++++
Регистрация: 15.01.2002
Адрес: Москва
Записей в блоге: 7
класс COM
new
Run on: Called
Description
The COM constructor creates an object of the COM class and optionally instantiates a COM object on any given computer to be attached to the COM class.

The first argument for new is the class name (see remarks) of the COM object to instantiate. If the class name is omitted no COM object is instantiated for the COM class, thus the attach method should be used to attach a COM object to the COM class.

The second argument for new is the name of the remote computer on which the COM object is to be instantiated. If the computer name is omitted the COM object is instantiated on the local computer. If the computer name is specified, it is required that the DCOM system component has been installed on both the local and remote computer as well as that the actual COM object in question supports DCOM and has been properly configured on both the local and remote computer. The DCOM system component is a standard component of Windows 98, Windows NT, and later. On Windows 95 the DCOM system component must be installed explicit.

Syntax
public final void new( [str _className, str _computerName] )

Arguments
className : The class name of the COM object to instantiate (optional).
computerName : The name of the remote computer on which the COM object should be instantiated (optional).
Remarks
The class name of a COM object is either its ProgID (programmatic identifier) or CLSID (class identifier):

ProgIDs have the following format: <program>.<component>.<version> (e.g. "AXAPI.Axapta.1 "). Note that the version element of the ProgID can often be omitted.

CLSID s are 128 bit values and have to following format: {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} (e.g. "{80F444A1-46FF-11D2-8459-0008C7A0D1EA}").

Example
PHP код:
{
    
// instantiate a COM object on local computer
    
COM comLocal  = new COM("MyCOM.Object");
 
    
// instantiate a COM object on remote computer
    
COM comRemote = new COM("MyCOM.Object""\\MyServer"); 
 
    
// don't instatiate any COM object yet
    
COM com = new COM();
    
    
// see the example under the 'attach' method as well