OLE and ActiveX

Strawberry Prolog supports OLE Automation - COM and ActiveX. This enables you to command standard programs like MS Word or Excel using your Strawberry Prolog program. This will open opportunities to incorporate such  programs into your Prolog program.

Use the function server in order to open OLE server. You can embed OLE server (ActiveX object) in your window by the predicate embed_server. In order to invoke methods and get and set properties use the operator point. You can listen for events which come back from the server. In order to do this open the server with server2 function. Also, on Strawberry Prolog you can write a server program which can send events back to its client by raise_event predicate.

If you want to command another program (server) then you have to know its commands (methods and properties). You can use the tool Object Browser (from menu Tools). With the help of this tool you can see all OLE servers which are installed on your computer. Also you can see their methods and properties. You can use any other description of this server (interface) provided by the authors of the server.

Keep in mind that some programs do not support OLE Automation (are not written as servers) and cannot be ruled from outside.

The support of OLE Automation is not an absolutely new opportunity because you already have it in Visual Basic, Delphi and Visual C++. However, Prolog (especially Strawberry Prolog) has definite advantages over other program environments and they are:

 1. Basic is suitable only for short programs but when the program becomes longer it gets messy.

 2. Delphi and Visual C++ are known as environments for professionals not only because you can create professional work using them but also because you need so much time to study through them that it is worth taking it on only if this is your profession.

See also:
Strawberry Prolog as OLE server
server, close
. (point)
embed_server
raise_event

Examples:
 Word.spj
 Chart.pro
 OLE
 OLE / Servers