Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by ahmd
Paul, you must be using plain Win32 calls in your software without any of the MFC or ATL stuff or any extensions to the language at all.
I don't use MFC or ATL.
Well, I thought so too... until I saw it with my own eyes. I'm not pulling your leg. If you want I can attach a Hello World executable here and you can try it for yourself. I think Marc's explanation has some merit:
That may be, but that is not a change in the executable format. That is a change in the library being used and library calls, not the actual format of an executable file. Similar to one of us making calls that exist in Windows 7, but do not exist in Windows XP -- the executable is in a valid format, but will not run correctly when run on XP.
I'm also assuming that you don't have SP1 installed on your VS 2008, do you?
Yes, I am using SP1, and have had no issues with older (older than Windows 7) operating systems.
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by ahmd
OK. I knew you'd ask it. So here you go. Two projects:
You didn't mention what version of the runtime library you're building with. Build them with the Multithreaded runtime (not DLL version), and then show us the results.
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by Paul McKenzie
I don't use MFC or ATL.
Yes, I am using SP1, and have had no issues with older (older than Windows 7) operating systems.
Well, I guess that if you don't use MFC or ATL then you might be safe.
I had access to MS VS 2008 at work and they let me compile a simple MFC project there and it ran under Win2K. But when they upgraded to SP1 MFC projects stopped working under Win2K or earlier. That has something to do with the new "fancy" MFC stuff they added there.
Originally Posted by Paul McKenzie
You didn't mention what version of the runtime library you're building with. Build them with the Multithreaded runtime (not DLL version), and then show us the results.
I can't seem to find that option for a console app. Where would it be?
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
The option is C/C++ -> Code Generation -> Runtime Library.
If you did that (changed to Mutlithreaded and not the DLL version of the runtime), you will see that your first example will not have any top-level dependencies on proprietary libraries (like MSVCRT80/90/whatever). That executable should run on any Windows 32-bit OS, probably even all the way down to Windows 98.
Regards,
Paul McKenzie
Last edited by Paul McKenzie; July 18th, 2010 at 07:46 PM.
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by Paul McKenzie
The option is C/C++ -> Code Generation -> Runtime Library.
If you did that (changed to Mutlithreaded and not the DLL version of the runtime)...
OK, just did. The Dependency Walker now shows only kernel32.dll but still when I run it on Win2K machine it gives me that "not a valid Win32 executable" error.
I need to get a trial version of VS 2008, install it and see if Marc's method with "Multi targeting" works...
On the side note, Paul, if you don't use MFC or ATL, how do you code your strings or dynamic arrays? With just plain C and Win32 it will be a torture. I hope you at least use STL.
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by ahmd
OK, just did. The Dependency Walker now shows only kernel32.dll but still when I run it on Win2K machine it gives me that "not a valid Win32 executable" error.
I don't have a Win2K partition active right now, so I can't test myself at this moment.
I have Visual 2010 installed, but never used it up until this post. I created a non-MFC "Hello World" program, statically linked runtime, and it works in Windows 7 and Windows XP.
On the side note, Paul, if you don't use MFC or ATL, how do you code your strings or dynamic arrays? With just plain C and Win32 it will be a torture. I hope you at least use STL.
Everything is STL and/or standard library calls, with the obvious Windows OS calls when necessary.
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by Paul McKenzie
I have Visual 2010 installed, but never used it up until this post. I created a non-MFC "Hello World" program, statically linked runtime, and it works in Windows 7 and Windows XP.
Yes, it does. But that is not the issue. I can guarantee that it won't work on anything earlier than XP.
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by ahmd
Yes, it does. But that is not the issue. I can guarantee that it won't work on anything earlier than XP.
A non-MFC program that uses the statically linked runtime library with no dependencies on redistributables should work.
I looked at the same file in Dependency Walker on XP and WIndows 7. When you open the KERNEL32.DLL tree for Windows 7, you see all sorts of DLL's being used. Open the same file in DW on XP, and you get NTDLL.DLL as the only dependency on KERNEL32.DLL. The EXE works in both XP and Windows 7.
Even though I don't have Win2K available, I still don't see technically, given what I've described, how an executable built the way I stated would not work on Win2K. If you happened to have built your EXE using some new-fangled EXE format that only Windows 7 and XP understands, then it's a matter of setting the switches on the compiler to build EXE's that will run correctly on other 32-bit OS'es.
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by Paul McKenzie
A non-MFC program that uses the statically linked runtime library with no dependencies on redistributables should work...
Paul, first of all, I appreciate your willingness to address this issue.
Since you don't have Win2K let's test it this way. Since you said you installed VS 2010 just for the sake of this post (which I appreciate, btw) build a release build for your test project (using VS2010) that you're sure will work under Windows 2000, attach it here and I'll try it on my side and tell you if it works or not.
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by ahmd
Paul, first of all, I appreciate your willingness to address this issue.
Since you don't have Win2K let's test it this way. Since you said you installed VS 2010 just for the sake of this post (which I appreciate, btw) build a release build for your test project (using VS2010) that you're sure will work under Windows 2000, attach it here and I'll try it on my side and tell you if it works or not.
If it doesn't work, then a lot of people would have complained who upgraded to VS 2010 for the enhancements in the C++ library, and they are developing standard C++ apps (no MFC, just Windows API calls, and STL/standard library usage, maybe boost, etc.).
There are a lot of companies who develop such things who don't touch MFC or ATL, but use Visual Studio because of its superiour development environment. Somehow, I doubt that these major players would like Microsoft, by default, generating EXE's and DLL's that will not work with Win2K, and for apparently no reasons whatsoever.
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by Paul McKenzie
I doubt that these major players would like Microsoft, by default, generating EXE's and DLL's that will not work with Win2K, and for apparently no reasons whatsoever.
Paul, I guess they should start changing their views about Microsoft ...
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by ahmd
Paul, I guess they should start changing their views about Microsoft ...
Many companies rely on having their standard, 32-bit software running on all 32-bit versions of Windows, save for Windows 95. The most these companies need to watch out for are API changes, and then change their code appropriately.
Upgrading the compiler is done solely for the C++ support for the new standard about to come out, better debugging and project management, etc.. They don't care one bit about MFC or ATL, but do care about the C++ support the compiler brings to them.
There should be some sort of compatibility switch within Visual Studio 2010 to allow creating EXE's that are valid executables for these other 32-bit OS'es. I remember that between versions of Visual Studio years ago, the import library format was changed, but Visual Studio still allowed creating import libraries using the old format.
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by Paul McKenzie
There should be some sort of compatibility switch within Visual Studio 2010 to allow creating EXE's that are valid executables for these other 32-bit OS'es.
Well, if you find it I sure would like to know it.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.