Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference Between Visual C++ and Visual C++ .net

Status
Not open for further replies.

a1715

Technical User
Sep 3, 2004
2
0
0
US
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
 
Visual C++ .NET is just Visual C++ 7.X -- there were two recent versions:

Visual C++ .NET 2002 = Visual C++ 7.0
Visual C++ .NET 2003 = Visual C++ 7.1

In other words, it's just a marketing name.
 
> 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)


---------------------- Done ----------------------

Build: 0 succeeded, 1 failed, 0 skipped


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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top