Serial Port Monitoring Control - ActiveX Component Library for RS232 Data Monitoring, API for Software Developers
Download Serial Port Monitoring Control Hide this button

ISerialMonitor Interface

This is the first interface you get from the hhdspmc library. It is used to get the list of installed serial devices and create Monitor objects.

Declaration

interface ISerialMonitor {
    // Properties

    // Methods
    ${CreateMonitor}(): ${IMonitoring};
    ${InstallLicense}(LicenseFile: string): void;
}
public interface ISerialMonitor
{
    // Properties
    ${IDeviceCollection} ${Devices} { get; set; }

    // Methods
    ${IMonitoring} ${CreateMonitor}();
    void ${InstallLicense}(string LicenseFile);
    void ${DisplayActivationDialog}(ulong WindowHandle);
    void ${InstallLicenseInMemory}(Array Data);
}
struct ISerialMonitor : IDispatch
{
    // Properties
    ${IDeviceCollectionPtr#IDeviceCollection} ${Devices};  // get set 

    // Methods
    ${IMonitoringPtr#IMonitoring} ${CreateMonitor}();
    HRESULT ${InstallLicense}(_bstr_t LicenseFile);
    HRESULT ${DisplayActivationDialog}(HWND WindowHandle);
    HRESULT ${InstallLicenseInMemory}(SAFEARRAY(byte) Data);
    HRESULT ${InstallLicenseInMemoryNative}(const UCHAR * pData, ULONG Size);
};

Examples

This example shows you how to create a SerialMonitor object:

let serialMonitor = new ActiveXObject()
var pSerialMonitor = new hhdspmcLib.SerialMonitor();
#import "hhdspmc.dll"

// ...

hhdspmcLib::ISerialMonitorPtr pSerialMonitor;
if (SUCCEEDED(pSerialMonitor.CreateInstance(__uuidof(SerialMonitor))))
{
    // ... work with object
}

ISerialMonitor Properties

Devices

// This property is not available in scripting environment
${IDeviceCollection} Devices { get; set; }
${IDeviceCollectionPtr#IDeviceCollection} Devices;  // get set 

Use this property to get the serial devices collection. Each installed serial device is present in this collection. If the serial device is currently not plugged to the computer, it still exists in this collection, but its Present property equals to false.

ISerialMonitor Methods

CreateMonitor

CreateMonitor(): ${IMonitoring};
${IMonitoring} CreateMonitor();
${IMonitoringPtr#IMonitoring} CreateMonitor();

Creates a new monitor object that is ready to be attached to serial device for monitoring.

InstallLicense

InstallLicense(LicenseFile: string): void;
void InstallLicense(string LicenseFile);
HRESULT InstallLicense(_bstr_t LicenseFile);
LicenseFile
Full path to the license file.

Install a given license file.

DisplayActivationDialog

// This method is not available in scripting environment
void DisplayActivationDialog(ulong WindowHandle);
HRESULT DisplayActivationDialog(HWND WindowHandle);
WindowHandle
Parent window handle.

Displays the activation dialog and lets the user to manually activate the SPMC.

InstallLicenseInMemory

// This method is not available in scripting environment
void InstallLicenseInMemory(Array Data);
HRESULT InstallLicenseInMemory(SAFEARRAY(byte) Data);
Data
License data in memory as byte array.

Install a license file, which contents is loaded into memory and provided in a byte array. Primary for managed clients.

InstallLicenseInMemoryNative

// This method is not available in scripting environment
// This method is not available in managed environment
HRESULT InstallLicenseInMemoryNative(const UCHAR * pData, ULONG Size);
pData
Pointer to the license data in memory.
Size
License data size, in bytes.

Install a given license file stored in a memory buffer. Provided primary for native clients who already loaded the license file into memory.