PDA

View Full Version : Visual C++ 6 or 7?


GallenWolf
06-06-2006, 06:29 PM
Hi all!
I have not programmed C++ since 2002, only Maxscript and Java, so please forgive my newbie-ness! I'm picking up some programming again, with the hopes of programming solutions for 3DS Max 7/8. According to the max sdk, the current builds require the use of Visual C++ 7.0, but on hand, I only have Visual C++ 6.0.

My question is, should I start my C++ learning path with the build used for the SDK, or can I begin on V6.0 and later jump onto 7? I'm not certain how different 6 will be from 7, as 7 is part of the ".Net" thing? I also do not intend to jump into programming for max in the near future. I need to get my basics down pat first with windows programming etc. before I even start figuring out the sdk.

Would appreciate any and all advice!

Alvin

DIMO
06-07-2006, 08:53 AM
Hi,

if you want to compile for 3dsmax 7 and 8 it is strongly recommendend that you use 7.0 (not even 7.1). This is because 3dsmax itself is compiled with 7.0. The memory management in 7.1 has changed and if you want to get stable plugins with 7.1 you have to use a lot of workarounds. This is all documented in the autodesk developer knowledge base. Perhaps you should have a look there.

The thing is it's not easy to buy 7.0 right now:)

Best Regards,
Dieter

Robert Bateman
06-07-2006, 10:53 AM
or download VC 2005 express edition & the Win32 platform SDK (free downloads), and that will work.

nurcc
06-08-2006, 08:06 PM
My question is, should I start my C++ learning path with the build used for the SDK, or can I begin on V6.0 and later jump onto 7? I'm not certain how different 6 will be from 7, as 7 is part of the ".Net" thing? I also do not intend to jump into programming for max in the near future. I need to get my basics down pat first with windows programming etc. before I even start figuring out the sdk.
As the other commenters have said, when you get around to building for max, it's probably a good idea to use exactly the same version of the compiler.

However, as for the rest of your question, there really isn't too big of a difference between MSVC 6, 7, 7.1, or 8, in terms of learning the language. MSVC 6 is really old, has horrible support for templates (and the STL) and the UI is pretty crufty. MSVC 7 was a major release in terms of UI improvement (although still kinda crufty), compiler quality and standards compliance, etc.

The .net thing was, IMHO, a big marketing mess. They experimented with naming everything XP (office, windows, etc.) and decided that maybe they'd try the same thing with .net. However, what they've done is muddied the waters about what on earth .net is all about. There's the IL and CLR, which is a way of using a single virtual machine with multiple languages. There's the library and framework. There's C#. There's SOAP. And then there's the branding campaign.

It seems that they've reverted to calling things by version number and/or by year, which is much clearer to me.

Basically, the thing to know about MSVC.net is that it supports the CLR, but only if you use managed C++. Personally, I don't use managed c++, because one of the reasons I like c++ is speed.

However, MSVC.net doesn't require that you use managed c++ - you can just use plain old c++. And the compiler is much better in general.

So, the short answer is, if you're just re-learning c++, don't worry about using managed c++. Pretty much any c++ compiler will do. You may want to use a more recent version to get better standards compliance, and eventually you should switch to the one that matches your target program, but for right now I wouldn't worry about it.

The free 2005 express edition should meet your needs nicely, and it's a bit nicer to use than msvc 6. It won't use the optimizing compiler, but for learning that's not really an issue.

GallenWolf
06-09-2006, 04:42 AM
Dear all,
Thank you very much for your advice, I have a much clearer path on how to proceed now :-)

Thanks again!

Regards,
Alvin

DavidB
06-16-2006, 04:33 AM
You may want to use a more recent version to get better standards compliance, . . .

I'd like to add to that comment by providing a specific example.

Say you are trying to declare memory dynamically with the "new" operator. If the attempted allocation is unsuccessful, the C++ standard says that a bad_alloc exception should be thrown.
Version 6 does not do this; instead, it returns NULL.
Version 7 and higher do, indeed, throw an exception as required by the standard.

Here's a page with a very basic example:

http://www.akiti.ca/DynamicArraysIntro.html

Off this page, three versions of the same code are posted.
The first uses version 6 and checks for NULL.
The second includes throw and catch blocks to deal with exceptions, but does not use the <vector> class.
The third version uses <vector> class and also includes throw and catch blocks to deal with exceptions that might occur when trying to re-size the array and vectors.

Hope this helps.


Regards,


David

Robert Bateman
06-17-2006, 03:56 AM
VC6 really does suck. Just don't use it. VC7 or 8 are the way to go. an even more specific example....


for(int i=0;i!=10;++i)
{
}
for(int i=0;i!=10;++i) // << fails in VC6, the original i is still in scope.
{
}

GallenWolf
06-20-2006, 04:56 AM
Hey all! Sorry for the late reply, work's very hectic, only awake at home for 2 hours a day :hmm: Man, looks like it's time for me to seek out VC7 on ebay :( Thank again everyone!

CGTalk Moderation
06-20-2006, 04:57 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.