就是那个经典的WTLClock3和WTLClock2;
编译后:
--------------------Configuration: WTLClock3 - Win32 Debug--------------------
Compiling...
stdafx.cpp
d:\vc98\include\atlframe.h(274) : error C2146: syntax error : missing ';' before identifier 'lpnm'
d:\vc98\include\atlframe.h(905) : see reference to class template instantiation 'WTL::CFrameWindowImplBase<TBase,TWinTraits>' being compiled
d:\vc98\include\atlframe.h(274) : error C2501: 'LPNMREBARCHEVRON' : missing storage-class or type specifiers
d:\vc98\include\atlframe.h(905) : see reference to class template instantiation 'WTL::CFrameWindowImplBase<TBase,TWinTraits>' being compiled
d:\vc98\include\atlframe.h(274) : error C2501: 'lpnm' : missing storage-class or type specifiers
d:\vc98\include\atlframe.h(905) : see reference to class template instantiation 'WTL::CFrameWindowImplBase<TBase,TWinTraits>' being compiled
d:\vc\zibian\wtlclock3\stdafx.cpp(8) : error C2856: #pragma hdrstop cannot be inside an #if block
Error executing cl.exe.WTLClock3.exe - 4 error(s), 0 warning(s)
编译后:
--------------------Configuration: WTLClock3 - Win32 Debug--------------------
Compiling...
stdafx.cpp
d:\vc98\include\atlframe.h(274) : error C2146: syntax error : missing ';' before identifier 'lpnm'
d:\vc98\include\atlframe.h(905) : see reference to class template instantiation 'WTL::CFrameWindowImplBase<TBase,TWinTraits>' being compiled
d:\vc98\include\atlframe.h(274) : error C2501: 'LPNMREBARCHEVRON' : missing storage-class or type specifiers
d:\vc98\include\atlframe.h(905) : see reference to class template instantiation 'WTL::CFrameWindowImplBase<TBase,TWinTraits>' being compiled
d:\vc98\include\atlframe.h(274) : error C2501: 'lpnm' : missing storage-class or type specifiers
d:\vc98\include\atlframe.h(905) : see reference to class template instantiation 'WTL::CFrameWindowImplBase<TBase,TWinTraits>' being compiled
d:\vc\zibian\wtlclock3\stdafx.cpp(8) : error C2856: #pragma hdrstop cannot be inside an #if block
Error executing cl.exe.WTLClock3.exe - 4 error(s), 0 warning(s)
void SetColors ( const COLORREF crText, const COLORREF crBkgnd )
{
m_crText = crText;
m_crBkgnd = crBkgnd;
RedrawWindow();
} bool IsClockRunning() const
{ return m_bClockRunning; }protected:
SYSTEMTIME m_stLastTime;
bool m_bClockRunning;
COLORREF m_crText, m_crBkgnd;
在CMainFrame的菜单响应函数中调用:
void CMainFrame::OnCPColors ( UINT uCode, int nID, HWND hwncCtrl )
{
m_view.SetColors ( RGB(0,0,0), RGB(255,153,0) );
}void CMainFrame::OnBWColors ( UINT uCode, int nID, HWND hwncCtrl )
{
m_view.SetColors ( RGB(255,255,255), RGB(0,0,0) );
}
而RedrawWindow();根本没用上COLORREF m_crText, m_crBkgnd;
BEGIN_MSG_MAP_EX(CMainFrame)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MSG_WM_TIMER(OnTimer)
END_MSG_MAP()
可以进入MSG_WM_TIMER看他“翻译”的消息