Visual C++

In order to use the COM objects in your C++ application, add the following import statement to your C++ source file, like this:

#import "<path>\WMonitorX.dll" named_guids

Optionally, you may add also:

using namespace WMonitorXLib;

in order to reference the objects without specifying the namespace.

Then create the object in the following way:

CComPtr<IWMonitorX> m_wMonitor;


In order to destroy the object, call:

m_wMonitor.Release ();

Note: before creating the object, CoInitialize API function must be called.