COM Forwarding

Make COM extensions cloud-ready with COM Forwarding

Operating mode

Cloud Suite

|

ON-PREMISES

Modules

Services & CRM

Budget & Phases

Purchases

Resource Planning

Business Intelligence

Created: 15.03.2024
Machine translated
Updated: 29.04.2024 | Added description to vtccom.createobject() and registry key.

Some Vertec extensions to third-party programs are based on a COM interface to the external system. However, since the connection only works locally, i.e. on the same computer, these extensions are not cloud ready and can only be used with the Vertec Desktop App and therefore only On-Premises.

With COM Forwarding, as of Vertec 6.7.0.7 there is a system with which COM objects of the external system can also be accessed from the cloud Cloud App.

For example, COM Forwarding objects can be used in the server Python Code side Python code, whose actions are then forwarded to the Cloud App where they are applied to the actual COM objects of the third-party program.

Module “vtccom”

The functionality for COM forwarding is included in the Vertec Python module vtccom, which is also available as a Stub File.

The feature vtccom.createobject(<progid>) returns a COM object that can be used in Python (see example below).

  • In the Desktop App created directly from the app using the Python COM system (win32com.client). This corresponds to the previous use of COM objects from Python.
  • In the Cloud App created by the client system via COM Forwarding. All interactions with the resulting Python object are transferred to the Cloud App and applied there to the actual COM object.

Rebuild existing, non cloud-ready extensions

Extensions that use COM Forwarding also work in the Desktop App.

If you use third-party COM extensions in Vertec (other than the ones supplied by default) and want to adapt them to COM Forwarding, you need to make the following changes:

vtccom.createobject() instead of win32com.Dispatch()

The COM objects are invoked using vtccom.createobject(identifier) instead of win32com.Dispatch.

To do this, the module vtccom must be imported and the calls must be changed as follows:

As of Vertec 6.7.0.7 Before
import vtccom
self.invoice = vtccom.createobject('ThirdPartyAPI.Invoice')
from win32com.client import Dispatch
self.invoice = Dispatch('ThirdPartyAPI.Invoice')
import vtccom
word = vtccom.createobject("Word.Application")
word.Visible = True
doc = word.Documents.Add()
doc.SaveAs(r"C:\temp\Test Document.docx")
from win32com.client import Dispatch
Word = Dispatch('Word.Application')
Word.Visible = True
doc = Word.Documents.Add()
doc.SaveAs(r"C:\temp\Test Document.docx")

To ensure backwards compatibility, vtccom.createobject() called in the Desktop App provides the original COM object.

Remove non-approved modules

In order for the extensions with COM Forwarding to work with restricted scripting, calls to modules such as sys or pywintypes must be removed. Only modules that are on the whitelist may be used.

Compatibility with COM objects

Depending on the implementation of the third-party product used (COM Server), COM Forwarding may cause incompatibilities. In these cases, the COM Server can only be used in the Desktop App.

Security

To prevent a COM Forwarding script on the server from “unnoticed” executing code in the Cloud App, the client user is asked for permission once when a COM server on the client is called, and this permission is saved on the client for future calls.

When accessing a COM server via COM Forwarding (calling vtccom.createobject()) a dialog appears in the Cloud App that a server script tries to access this object on the client.

  • If access is allowed, the script is executed and the permission is saved on the client. The query will not appear on future calls to the same COM server.
  • If access is not allowed, execution will be aborted without a message. The message will appear again on repeated access.

The accounting interfaces with COM Forwarding supplied by us are already stored. This means that this query does not arrive with them even when they are called up for the first time.

The authorized COM servers are saved in the registry key HKEY_CURRENT_USER\SOFTWARE\Vertec\ComObjectWhitelist.

Netherlands

United Kingdom