Click to See Complete Forum and Search --> : Compile error-change vc6 project into vc.net
hydrazx
August 25th, 2003, 11:21 PM
I use .Net2003 open a project made by VC6, but when I compile this project, there is a error happen in "ON_COMMAND_RANGE(ID_CREATE_LINE, ID_CREATE_ARC, OnCreateEntity)"
The error information:
c:\JohnsonFiles\VCAD3.0\VCADVIEW.CPP(43): error C2440: 'static_cast' : cannot convert from 'void (__thiscall CVCadView::* )(int)' to 'void (__thiscall CCmdTarget::* )(UINT)'
The .Net doesn't support COMMAND RANG? How do I deal this? Thanks.
MooNull
August 25th, 2003, 11:34 PM
From the looks of it, its an error to do with static_cast not the function itself. Nor is it an error to due with conversion from vc6 to vc.net.
It is a simple everyday compilation error. static_cast doesn't like what you are doing. More code would help.
Of course, I reserve the right to be wrong.
hydrazx
August 27th, 2003, 08:29 AM
yes, it happened when I convert the project form VC6 to VC.net
DelboyDee
August 28th, 2003, 04:45 AM
I had the same problem trying to use OnMessage in my App Thread. It seems that Microsoft has changed this code to make it more robust which has ended up causing us no end of pain.
By the l;ooks of things your function wants an 'int' but the core is expecting a 'UINT' change your function to use a UINT and see if that helps.
'void (__thiscall CVCadView::* )(int)'
'void (__thiscall CCmdTarget::* )(UINT)'
From what I can see in the MSDN, ON_COMMAND_RANGE is still supported. If you need to get this working quickly then you may have to do each command seperately !!!
Delboy
hydrazx
August 28th, 2003, 10:04 AM
Thanks everybody, I resloved the problem. I changed On_Command parameter, using UINT replace int. It's OK! :-)
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.