Contents Previous Next Subchapters

Creating a Connection to a COM/Automation Server
Syntax cocreate(server program ID)
cocreate
See Also cowith

Description
Creates a connection to the COM automation server that is identified with the character row vector server program ID. If no argument is specified the cocreate function returns a character row vector that identifies the currently connected server.

O-Matrix may be connected to no more than one server at a time. If cocreate is called while a server is connected the current connection is released before the new request is established. Calling the O-Matrix clear command will terminate all server connections.

Example
If at the command prompt you enter
     cocreate("Excel.Application")
O-Matrix will initialize the Windows OLE/COM services and create a connection to the Excel Application object. If you continue the example above by entering
     cocreate
O-Matrix will respond
     Excel.Application
If you continue the example by entering
     cocreate("Word.Application")
     cocreate
O-Matrix will respond
     Word.Application