When read or clear clipboard is clicked from the mainframe menu in the WTL sample compiled with vs2013
CHAIN_COMMANDS_MEMBER(m_wndFormatList) pases messages from the mainframe to the member list control but the message is null?
Stack trace:
WTLClipSpy.exe!ATL::CWindowImplRoot<WTL::CListViewCtrlT<ATL::CWindow> ::SetMsgHandled(int bHandled) Line 3213 C++
WTLClipSpy.exe!CClipSpyListCtrl::ProcessWindowMessage(HWND__ * hWnd, unsigned int uMsg, unsigned int wParam, long lParam, long & lResult, unsigned long dwMsgMapID) Line 30 C++
WTLClipSpy.exe!CMainFrame::ProcessWindowMessage(HWND__ * hWnd, unsigned int uMsg, unsigned int wParam, long lParam, long & lResult, unsigned long dwMsgMapID) Line 41 C++
Debug output:
Debug Assertion Failed!
Program: ...nloads\source\WTL4MFC7_demo\WTLClipSpy.\Debug\WTLClipSpy.exe File: c:\program files (x86)\microsoft visual studio 12.0\vc\atlmfc\include\atlwin.h Line: 3213
Expression: pMsg != 0
It is likely to be a regression problem with a not so popular CHAIN_COMMANDS_MEMBER
macro.
A workaround might look like this:
//CHAIN_COMMANDS_MEMBER(m_wndFormatList)
if(uMsg == WM_COMMAND)
{
lResult = m_wndFormatList.SendMessage(uMsg, wParam, lParam);
if(lResult == 0)
return TRUE;
}
Or, if you prefer to bypass SendMessage
API (makes sense), then you will need to take care of m_pCurrentMsg
initialization in the chained control. A better but longer fix.