How to integrate CClockST in your application
In your project include the following files:
ClockST.h
ClockST.cpp
Also include the following bitmap resources:
IDB_CLOCKST_PANE (ClockST_pane.bmp)
IDB_CLOCKST_BIG (ClockST_big.bmp)
IDB_CLOCKST_SMALL (ClockST_small.bmp)
Use dialog editor to create a static text called, for example, IDC_CLOCKFRAME (no matter what size you give it, it will be resized by CClockST) and create a member variable for this static control:
CClockST m_Clock;
Now attach the static control to CClockST. For dialog-based applications, in your OnInitDialog:
// Call the base-class method
CDialog::OnInitDialog();
// Create the clock
m_Clock.SubclassDlgItem(IDC_CLOCKFRAME, this);
Or in your DoDataExchange:
// Call the base method
CDialog::DoDataExchange(pDX);
// Create the clock
DDX_Control(pDX, IDC_CLOCKFRAME , m_Clock);
Now start the clock, passing the ID resources of the bitmaps to use:
// Start clock
m_Clock.Start(IDB_CLOCKST_PANE, IDB_CLOCKST_BIG, IDB_CLOCKST_SMALL);
Your clock is now active! The static control created with dialog editor has been resized to
match the same size of the clock. There is no way to stop the clock once started.
Class methods
Start
Starts (and displays) the clock loading all the necessary bitmaps
and creating the worker thread.
// Parameters:
// [IN] nPaneID
// ID number of the bitmap resource of the whole clock.
// [IN] nBigID
// ID number of the bitmap resource of the big digits.
// [IN] nSmallID
// ID number of the bitmap resource of the small digits.
// [IN] bAlternateDateFormat
// TRUE to display date in mm-dd-yyyy format, else
// FALSE to display date in dd-mm-yyyy format.
//
// Return value:
// CLOCKST_OK
// Function executed successfully.
// CLOCKST_INVALIDRESOURCE
// Some error loading bitmaps.
// CLOCKST_THREADKO
// Failed creating worker thread.
//
DWORD Start(int nPaneID, int nBigID, int nSmallID, BOOL bAlternateDateFormat = FALSE)
GetVersionI
Returns the class version as a short value.
// Return value:
// Class version. Divide by 10 to get actual version.
//
static short GetVersionI()
GetVersionC
Returns the class version as a string value.
// Return value:
// Pointer to a null-terminated string containig the class version.
//
static LPCTSTR GetVersionC()
VC6里面出现这个错误
'RT_GROUP_BITMAP' : undeclared identifier
可以把RT_GROUP_BITMAP改成RT_GROUP_ICON就OK