This is the first interface you get from the USBMC library. It is used to get the list of installed USB devices and create Monitor objects. You get a reference to this interface when you create the UsbMonitor
object. It is a central entry point to the monitoring library.
CComPtr<IUsbMonitor> pUM;
HRESULT hr = pUM.CoCreateInstance(__uuidof(UsbMonitor));
if (FAILED(hr))
{
MessageBox(L"Error opening the USBMC control", L"Error", MB_ICONSTOP | MB_OK);
return TRUE;
}
// use pUM here
hhdusbmcLib.UsbMonitor mc = new hhdusbmcLib.UsbMonitor();
// use mc here
interface IUsbMonitor extends ${IDispatch} {
// Properties
readonly ${Devices}: ${IDeviceCollection};
// Methods
${CreateMonitor}(): ${IMonitoring};
${InstallLicense}(LicenseFile: string): void;
}
public interface IUsbMonitor : ${IDispatch}
{
// Properties
${IDeviceCollection} ${Devices} { get; }
// Methods
${IMonitoring} ${CreateMonitor}();
void ${InstallLicense}(string LicenseFile);
void ${InstallLicenseInMemory}(byte[] data);
void ${DisplayActivationDialog}(IntPtr hWnd);
}
struct IUsbMonitor : IDispatch
{
// Properties
${IDeviceCollectionPtr#IDeviceCollection} ${Devices}; // get
// Methods
${IMonitoringPtr#IMonitoring} ${CreateMonitor}();
HRESULT ${InstallLicense}(_bstr_t LicenseFile);
HRESULT ${InstallLicenseInMemoryNative}(UCHAR * pData, ULONG size);
HRESULT ${DisplayActivationDialog}(HWND hWnd);
};
readonly Devices: ${IDeviceCollection};
${IDeviceCollection} Devices { get; }
${IDeviceCollectionPtr#IDeviceCollection} Devices; // get
Reference to the device collection object.
CreateMonitor(): ${IMonitoring};
${IMonitoring} CreateMonitor();
${IMonitoringPtr#IMonitoring} CreateMonitor();
Creates a new monitor object that is ready to be attached to USB device.
InstallLicense(LicenseFile: string): void;
void InstallLicense(string LicenseFile);
HRESULT InstallLicense(_bstr_t LicenseFile);
LicenseFile
Install a license stored in a given file.
// This method is not available in scripting environment
void InstallLicenseInMemory(byte[] data);
// This method is not available in native environment
data
Install a license stored in a memory buffer.
// This method is not available in scripting environment
// This method is not available in managed environment
HRESULT InstallLicenseInMemoryNative(UCHAR * pData, ULONG size);
pData
size
pData
, in bytes.Install a license stored in a memory buffer.
// This method is not available in scripting environment
void DisplayActivationDialog(IntPtr hWnd);
HRESULT DisplayActivationDialog(HWND hWnd);
hWnd
0
.Display the activation dialog.