mrDarker
2025-08-06 2379434200219132ee252f12d47a1e5efd160f42
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#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;
};