For some reason, the compiler is giving me an error when I try to use a custom message. Here's the problem:
Code:
error C2440: 'static_cast' : cannot convert from 'void (__thiscall CStageZeroNetworkAnalysisView::* )(WPARAM,LPARAM)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'
And how I implemented it:
Code:
//////// View.h
afx_msg void OnNewPacket(WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
//////// View.cpp
BEGIN_MESSAGE_MAP(CStageZeroNetworkAnalysisView, CView)
ON_MESSAGE(MSG_NEW_PACKET, OnNewPacket)
END_MESSAGE_MAP()
///////// The function
void CStageZeroNetworkAnalysisView::OnNewPacket(WPARAM wParam, LPARAM lParam)
{
ZeroPacket* ZP = new ZeroPacket();
ZP->SetData((pcap_pkthdr*)wParam, (u_char*)lParam);
ZP->Serialize(ZData);
}
Any help will be much appreciated. Thanks.