Add custom license support
- Last UpdatedNov 18, 2024
- 1 minute read
To add custom license support:
-
Add DeviceEngine.lib dependency to the Communication Driver runtime project.
-
Include DeviceEngine.h, CustomLicenseMgr.h and CustomLicenseMgr.cpp in the Communication Driver runtime project.
-
Derive Communication Driver runtime from SvIoCustomLicenseServer class.
Ex: class SAMPLEServer : public SvIoCustomLicenseServer
-
Implement IsLicensed() and GetDemoTimeout()functions (see an example of the Add IsLicensed() and GetDemoTimeout() functions below).
Add IsLicensed and GetDemoTimeout (Example):
-
Declare IsLicensed() and GetDemoTimeout() methods in <ServerName>Class.h.
virtual bool IsLicensed(bool* tolog, wstring* feature, wstring* version);
virtual DWORD GetDemoTimeout();
-
Define IsLicensed() and GetDemoTimeout() methods in <ServerName>Hierarchy.cpp
bool SAMPLEServer::IsLicensed(bool* tolog, wstring* feature, wstring* version)
{
bool bLicensed = true;
// TODO - take server-specific action
return bLicensed;
}
DWORD SAMPLEServer::GetDemoTimeout()
{
DWORD DemoTime = 120; // Demo time = 120 mins
// TODO - take server-specific action
return DemoTime;
}
To follow the step-by-step process of adding custom licensing, refer to the OISDK_CustomLicense_Support.mp4 video in the C: > Program Files(x86) > Wonderware > OI-Server > OI-SDK > SamplesAndVideos > Videos folder.
Note:
- The video was recorded in VS2017, but the procedure remains the same in VS2022.
- In the video, you may see the folder name as 'Toolkit' instead of 'SDK'.