#pragma once
|
|
enum LicenseKey_Status {
|
LicenseKey_NotConnected = 0, // 楷搬 救凳
|
LicenseKey_NotCertified, // 牢刘 救凳
|
LicenseKey_NotActivated, // 咀萍海捞记 救凳
|
LicenseKey_Activated // 咀萍海捞记 凳
|
};
|
|
struct SLicenseStatus
|
{
|
SLicenseStatus()
|
{
|
Reset();
|
}
|
|
void Reset()
|
{
|
nKeyStatus = LicenseKey_NotConnected;
|
nUsbID = 0;
|
strSerialNo = L"";
|
}
|
|
bool operator==(const SLicenseStatus &rhs)
|
{
|
return (this->nKeyStatus == rhs.nKeyStatus);
|
}
|
|
int nKeyStatus;
|
unsigned int nUsbID;
|
CString strSerialNo;
|
CTime expTime;
|
};
|
|
interface IWorkerUpdateLicense2Parent
|
{
|
virtual void IWUL2P_LicenceStatus(int nIndex, const SLicenseStatus& sStatus) = 0;
|
};
|
|
class CWorker_UpdateLicense
|
{
|
public:
|
CWorker_UpdateLicense(int nIndex, IWorkerUpdateLicense2Parent *pIWUS2P, DWORD dwTick=1000);
|
virtual ~CWorker_UpdateLicense();
|
|
virtual BOOL StartThread();
|
virtual void StopThread();
|
|
|
static UINT UpdateLicense(LPVOID pParam);
|
UINT Update_License_Func();
|
|
protected:
|
virtual void Update_License();
|
|
protected:
|
int m_nIndex;
|
DWORD m_dwTick;
|
BOOL m_bUpdate;
|
HANDLE m_hThreadDone;
|
IWorkerUpdateLicense2Parent* m_pIWUL2P;
|
SLicenseStatus m_sStatus;
|
};
|