[quoted text, click to view] "Ommund" <Ommund.Ogard@c2i.no> wrote in message
news:Er6hd.3414$HA5.418683@juliett.dax.net...
> Hi
>
> I have an MFC application originally developed in VC++ 6.0. The port to
VC++
> 2003 went fine except for a few message handlers:
>
> In the .h file
>
> afx_msg void OnPingFailed( WPARAM wParam, LPARAM lParam);
>
> In the .cpp file
> .cpp fil (event map)
>
> ON_THREAD_MESSAGE(ID_AXIS_PING_FAILED, OnPingFailed)
> og
>
> void CDbServer3Dlg::OnPingFailed( WPARAM wParam, LPARAM lParam)
> {
>
> // Do nothing, but provide some trace for debugging
> int iServerIndex = static_cast<int>(wParam);
>
> ...
> return;
> }
>
> The application is a simple dialogue based application where CDbServer3Dlg
> is derived from CDialog.
>
> I get the following error messages when the code is compiled in VC++ 2003
> d:\AutroOS\Product\Server\DB_Server\src\DbServer3Dlg.cpp(118) : error
> C2440: 'static_cast' : cannot convert from 'void (__thiscall
> CDbServer3Dlg::* )(WPARAM,LPARAM)' to 'void (__thiscall CWinThread::*
> )(WPARAM,LPARAM)'
> None of the functions with this name in scope match the target
type
>
> in task list:
> d:\AutroOS\Product\Server\DB_Server\src\DbServer3Dlg.cpp(118): error
C2440:
> 'static_cast' : cannot convert from 'void (__thiscall CDbServer3Dlg::*
> )(WPARAM,LPARAM)' to 'void (__thiscall CWinThread::* )(WPARAM,LPARAM)'
>
> Does anyone know what the problem might be?
I think it's telling you that CDbServer3Dlg does not derive from CWinThread
and that ON_THREAD_MESSAGE requires such derivation. Presumably
CDbServer3Dlg derives from CWnd and in which case ON_MESSAGE would be more
appropriate.
--
Jeff Partch [VC++ MVP]