ActiveX, COM and OLE
From Xojo Documentation
OLE (Object Linking and Embedding) and COM (Component Object Model) are ways to communicate with Windows objects in your applications. ActiveX describes controls that utilize COM or OLE. All of these features are Windows-specific and cannot be used in a cross-platform app.
You use the OLEObject, OLEContainer, OLEParameter and OLEException classes to access these Windows features.
OLEObject
OLEObject can be used to send messages to other Windows apps that support OLE, such as Internet Explorer. Use the Value method to get and set values of the OLE object. Use the Invoke method to call methods (with or without arguments) on the OLE object.
This code creates a connection to Internet Explorer and then tells it to display Wikipedia:
Var v As Variant
Var params(1) As Variant
obj = New OLEObject("InternetExplorer.Application", True)
obj.Value("Visible") = True
params(1) = "http://www.wikipedia.org%22
v = obj.Invoke("Navigate", params)
Exception e As OLEException
MessageBox(e.message)
OLEContainer
OLEContainer is used to embed ActiveX controls into your apps.
To use an OLEContainer, you drag it from the Library onto a Window. In the ProgramID property of the Inspector, you specify the program ID for the control. You can access the properties and methods of the ActiveX by using the Content property, which returns an OLEObject where you can use the Value and Invoke methods.
This code (in a Button's Action event) displays a PDF in an Adobe Reader ActiveX OLEContainer that has been added to a window:
Depending on the version of Adobe Reader, you may need to click on the container before the PDF is displayed.
To print the PDF in the OLEContainer, you can call the “printWithDialog” method of the Adobe Reader ActiveX control:
Using Insert ActiveX Component
You can also directly add ActiveX controls and automatable/OLE objects by selecting Insert ↠ ActiveX Component from the menu. This displays a window with two tabs: Controls and References. The Controls tab lists the ActiveX controls that you can add to a window. The References tab lists the automatable COM objects are are not controls, like the iTunes Library, Microsoft Word, etc.
When you select an item and click OK, a module (containing classes for the component) is added to your project for you to use. Refer to the docs for the component to understand how to use its classes, methods and properties.
Note that not all ActiveX controls can be used with Xojo.
See Also
OLEObject, OLEContainer, OLEParameter, OLEException classes; Variant data type