This document explains how ActiveX controls can set up in IBM Personal Communications
The Support of ActiveX/OLE in IBM Personal Communications (PCOMM) is limited and has minimal support for Office/Lotus tools, which can be used further in automating the operations within PCOMM. However, PCOMM does not provide a way to embed itself as a full-fledged ActiveX object, or having it instantiated as a Form Object.
While PCOMM provides the API interface (HACL Automation / COM objects) for .NET Framework targeted applications (such as the WinForms application), the ActiveX/OLE support provided by PCOMM is primitive. There is no API interface to embed PCOMM Runtime.
What has changed with IBM Personal Communications v184.108.40.206?
PCOMM 220.127.116.11 packages pcsctrX.ocx – an ActiveX Control which can be hosted in an OLE container. An OLE container control lets you add an OLE objects to your applications. OLE objects include ActiveX Controls (.OCX files) and insert-able OLE objects created in other applications such as Microsoft Word and Microsoft Excel.
After adding pcsctrX.ocx into an OLE container or an Automation Client, users can start a PCOMM session in the ActiveX control by providing Session ID (optional) and the PCOMM Workstation profile (mandatory). Once started, PCOMM session will be embedded in the application.
This control supports:
- ActiveX Control for PCOMM achieves all the features of Statically and Dynamically Embedding PCOMM as an ActiveX control object in a windows Form (or .NET application).
- Users can launch PCOMM by providing two important parameters:
- When set: This can be set from ‘A’ to ‘Z’.
- Blank: The Control logic generates the SessionID and Launches the PCOMM with next available Session ID.
- Already existing/launched: Provides an option to the user to embed the same session in the ActiveX control.
- Session Profile name may or may not have a ‘.ws’ extension.
- If path is not provided, then the default path is picked up from the registry.
- With Customized path, PCOMM is launched with the .ws file from customized path.
- Automation/Screen Scraping: Operations based on automation objects (HACL) and Emulator Programming (ELLAHPI) are supported.
- Menu and Toolbar Items in the Embedded PCOMM (pcsctrX) are hidden.
- Errors/Exceptions are handled.
Session ID (Optional):
1. Visual Studio 2005 or higher: To build a client application using pcsctrX.ocx.
2. Microsoft Office (32 bit): If client application executes on a Microsoft Office application.
3. IBM Personal Communication Ver 18.104.22.168 or higher.
Register pcsctrX.ocx on a system where users need to execute the OLE/Automation Container Application built with pcsctrX.ocx.
To register, execute below command in command window with elevated permission:
To unregister, execute below command in command window with elevated permission:
regsvr32 /u pcsctrX.ocx
CHAR pcsOcxStartSession (CHAR sessID, BSTR wsProfile)
Starts PCOMM session in the ActiveX Control window by using a specified workstation profile and A (optional) short session ID can also be specified.
• sessID: Presentation space short session ID. It is optional and if not provided then next available session ID is assigned.
• wsProfile: Path and complete filename of the profile to load. Path is optional but complete filename is mandatory.
• Return Value
- o Returns the Presentation space short session ID.
o If sessID was provided, then same value is returned else new assigned session Id is returned.
o If PCOMM session failed to start, then a blank/NULL value is returned.
Connect the PCOMM emulator to the host data stream. This has the same effect as going to the PCOMM emulator Communication menu and choosing Connect.
- Return Value
- Returns true if connected successfully else false.
Disconnect the PCOMM emulator to the host data stream. This has the same effect as going to the PCOMM emulator Communication menu and choosing Disconnect.
- Return Value
- Returns true if disconnected successfully else false.
PCOMM Window Recognition
pcsctrX.ocx recognizes PCOMM window based on its name, “Session ID *“.
for e.g. Session A – [24 x 80].
If this naming standard is not followed (by changing Edit->Preferences->Display Setup configurations), then the PCOMM session will be failed to appear in ActiveX control screen.
Redundant Disconnect context item
Disconnect context Menu item which appears in a static invoke method on the pcsctrX ActiveX control is redundant. This limitation would be taken care in the upcoming release.
Menu and Toolbar state conflict
If PCOMM Session profile is same as the one specified in the Embedded ActiveX control, then PCOMM shall be Embedded in the ActiveX control without any change in state, however, the Menu and the Toolbar items are visible. This limitation would be taken care in the upcoming release.
To receive notification of all OIA events in a pcsctrX.ocx container application, used IBM PCOMM method ‘RegisterOIAEvent‘, but the container application fails to receive event notification from autOIA.
It is a defect in the automation API ‘RegisterOIAEvent’.
Resolving The Problem
03 February 2020