Hi,
I am working on a simulation in Visual C++. I found that my simulation showed errors when I compiled it in Visual c++ .net . Is there any difference between Visual C++ and Visual C++ .net?
Please reply!!!
I am really confused!!
Thanks
Aruna
> I found that my simulation showed errors when I compiled it in Visual c++ .net
It's a better compiler (and more compliant with the C and C++ standards), which generally means it tolerates a lot less poor coding than VC6 does.
You would need to post some code and some error messages for a more specific answer.
Hi,
Thanks a lot for replying. Actually, this is my problem. I am using VC++ .net 2003 version to compile a program previously written in classic VC++.
The part of the code where the problem occurs is:
/ Windows message map.
BEGIN_MESSAGE_MAP( BoidsWin, CFrameWnd )
ON_WM_CREATE( ) -------> this is where the error message points to
ON_WM_PAINT( )
ON_WM_HSCROLL( )
ON_BN_CLICKED( 1, OnCentre )
ON_BN_CLICKED( 2, OnStartStop )
ON_WM_NCLBUTTONDOWN( )
ON_WM_NCRBUTTONDOWN( )
ON_WM_SIZE( )
ON_WM_CLOSE( )
ON_WM_DESTROY( )
// Window's Menu Items.
// Found in 'BoidsWinMenu.cpp'........................... code goes on.........
The error message output is:
------ Build started: Project: 3DBoids, Configuration: Debug Win32 ------
Compiling...
BoidsWin.cpp
WINVER not defined. Defaulting to 0x0501 (Windows XP and Windows .NET Server)
c:\Documents and Settings\Eric Michael\Desktop\try\new_boids\BoidsWin.cpp(15) : error C2440: 'static_cast' : cannot convert from 'void (__thiscall BoidsWin::* )(void)' to 'int (__thiscall CWnd::* )(LPCREATESTRUCT)'
None of the functions with this name in scope match the target type
Build log was saved at "file://c:\Documents and Settings\Eric Michael\Desktop\try\new_boids\Debug\BuildLog.htm"
3DBoids - 1 error(s), 0 warning(s)
This is what I got as the error. Trust me... the program works very well in classic Visual C++6.0
I did not make any changes to the program and compiled it using .net, but got these errors. I even made the warning level to "NONE" for this program.
Is there any changes that I have to make in the code before I compile it using the vc++ .net . If any changes should be made, could anyone tell me what are the changes that I have to make?
Please help!!!!
Thanks
Aruna
At a guess, what it is moaning about is BoidsWin::Create or BoidsWin::OnCreate. It wants an LPCREATESTRUCT parameter even though it may not use it. It also wants an int returned. Basically, the prototype is wrong. You can get away with it on VC6 but not with VC7.
I use API function GetCaretPos( LPRECT p_rect ) to get current position of cursor, but I don't know how I can get a handle to this cursor's window. I have a few text fields (CEdit) on my dialog base application and I want to know in what of these fields cursor is.
plevin@engineer.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.