migrate evc4 to vs2005 generate error C2440: 'static_cast' : cannot convert from 'LRESULT (__cdecl CBBADLLApp::* )(WPARAM,LPARAM)' to 'LRESULT (__cdecl CWnd::* )(WPARAM,LPARAM)'



When I migrate the evc4 program (dll program) to vs2005 for
WM5 the code generate error.

When I added CWnd in the CXXXXDLL.h
class CXXXXDLLApp : public CWinApp, CWnd
{
....
}
then the code can compile without error, but if I put this dll in the
program it will cause the program to halt. Is it approach correct or not?
Or it has other workaround?

Code's Details:
------ Build started: Project: XXXXDLL, Configuration: Debug Pocket PC 2003
(ARMV4) ------
Compiling...
XXXXDLL.cpp
..\XXXXDLL.cpp(56) : error C2440: 'static_cast' : cannot convert from
'LRESULT (__cdecl CXXXXApp::* )(WPARAM,LPARAM)' to 'LRESULT (__cdecl CWnd::
* )(WPARAM,LPARAM)'
None of the functions with this name in scope match the target type
Creating browse information file...
Microsoft Browse Information Maintenance Utility Version 8.00.50727
Copyright (C) Microsoft Corporation. All rights reserved.
Build log was saved at "file://c:\Projects\XXXXDLL\Pocket PC 2003 (ARMV4)
\Debug\BuildLog.htm"
XXXXDLL - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

XXXXDLL.cpp
BEGIN_MESSAGE_MAP(CXXXXApp, CWinApp)
ON_MESSAGE( WM_SCANTRIGGER, OnMyEvent ) <--Error Line
END_MESSAGE_MAP()

LRESULT CXXXXApp::OnMyEvent(WPARAM wParam,LPARAM lParam)
{
....
return 1;
}

XXXX.h
class CXXXXApp : public CWinApp
{

public:
CXXXXApp();
~CXXXXApp();

// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CXXXXApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL

afx_msg LRESULT OnMyEvent(WPARAM,LPARAM);

//{{AFX_MSG(CXXXXApp)
// NOTE - the ClassWizard will add and remove member functions
here.
// DO NOT EDIT what you see in these blocks of generated code
!
//}}AFX_MSG

DECLARE_MESSAGE_MAP()
};

.


Loading