473,320 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Porting MFC app from VC6 to 2003

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\DbServer3D lg.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\DbServer3D lg.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?

Regards
Ommund


Nov 17 '05 #1
1 2021
"Ommund" <Om**********@c2i.no> wrote in message
news:Er*******************@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\DbServer3D lg.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\DbServer3D lg.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]
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: seeni | last post by:
I have created an addin to use in visual studio 2002. How to port the addin to Visual studio 2003? When I installed setupmsi in the machine containing visual studio 2003, the addin is not...
2
by: kikotores | last post by:
I am going back home for the summer but I have this big project to submit for one of my classes. It is written in Visual C++ 7.0 . Hoever the only C++ compiler I have at home is the free Borland...
11
by: Errol Neal | last post by:
Hi all, Not sure if this is a question for a php list or this one, but I'll give it a shot and if I am wrong, please do not crucify me. :-) There is a php based sourceforge project called...
4
by: Chris Travers | last post by:
Hi all; A few years ago, I set about porting a PHP application from MySQL to PostgreSQL, after realizing that MySQL wasn't going to be able to handle it. In order to do this, I built a light,...
3
by: slarti | last post by:
My VS6 version used #include <fstream.h> which for VS.net I had to change to #include <fstream> using namespace std; Now I get a compiler error :
5
by: BK-Chicago | last post by:
I am in the midst of porting a massive MFC application from VS6.0 to VS8.0. While i have fixed most of the compile time errors, i do have quite a linker error that i have not been able to resolve....
4
by: Chuck Chopp | last post by:
I have an application that I originally built using Visual Studio .NET 2003 as native C++ . This application includes a template class that was derived from the string class that's part of the C++...
1
by: Andy | last post by:
Hi, I noticed when migrating a 2002 application to 2003 that the system changed to a different usage for pow(2,-15). In 2002, it used double pow(double,double). In 2003, it is using double...
0
by: viren.chaudhary2008 | last post by:
I have just few questions. We are thinking of porting our 32 bit application to 64 bit as we need to use more memory usage and want to take advantage of 64 bit processor. Currently my applications...
1
by: viren.chaudhary2008 | last post by:
I have just few questions. We are thinking of porting our 32 bit application to 64 bit as we need to use more memory usage and want to take advantage of 64 bit processor. Currently my applications...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.