-
July 17th, 2010, 01:24 AM
#1
MS Visual Studio 2010 and support for Windows 9x and 2000
I am seriously planning to switch to the MS Visual Studio 2010 but I just realized today after updating my project for the whole day that while trying to run it on Windows 2000 it produces this error:
<Executable file path> is not a valid win32 application.
Is it true that the code compiled with it will work only on Windows XP, Vista and Windows 7?
-
July 17th, 2010, 06:53 AM
#2
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Maybe you have build a 64 bit version of your application and Windows 2000 cannot run 64 bit executables. Build it as 32 bit and try again.
-
July 17th, 2010, 03:55 PM
#3
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by Marc G
Maybe you have build a 64 bit version of your application and Windows 2000 cannot run 64 bit executables. Build it as 32 bit and try again.
No, it's not. Besides double-checking in the project properties I also ran the code on a 32-bit Windows XP platform and it ran just fine.
Originally Posted by S_M_A
I especially like this part:
VS2010 introduces a new "Target Name" property in the General page of Configuration Properties. I still haven't figured out the rationale...
I haven't either.... It took me about 3 hours to make one of my previous projects compile on VS 2010.
OK, so I made an experiment. I compiled a simple Hello World console application using MS VS 2010.
1. First, without MFC or ATL. Just the following line:
Code:
_tprintf(_T("Hello world!\n"));
The size of the Release Unicode x86 build was around 6K. OK. I can live with that. But, if I run that code on Windows 2000 it simply shows the error "<Executable file path> is not a valid win32 application."
2. Then if I do pretty much the same, Win32 console app with MFC and use the following lines:
Code:
CString s;
s.Format(_T("Hello world!\n"));
_tprintf(s);
The size of the Release Unicode x86 build (with statically linked MFC libraries) mushrooms to, get ready for this, 1.54MB!!! Just for those 3 lines of code and a sh*t ton of MFC stuff that will never be used in this project. And obviously it doesn't run on Win2K either.
All that is BAD!
-
July 17th, 2010, 04:13 PM
#4
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by ahmd
2. Then if I do pretty much the same, Win32 console app with MFC and use the following lines:
Code:
CString s;
s.Format(_T("Hello world!\n"));
_tprintf(s);
The size of the Release Unicode x86 build (with statically linked MFC libraries) mushrooms to, get ready for this, 1.54MB!!! Just for those 3 lines of code and a sh*t ton of MFC stuff that will never be used in this project. And obviously it doesn't run on Win2K either.
Did you try that with dynamic linking to MFC? This pretty sure wouldn't run on Win2k either, but I would be interested in the release EXE file size.
-
July 17th, 2010, 05:32 PM
#5
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by Eri523
Did you try that with dynamic linking to MFC? This pretty sure wouldn't run on Win2k either, but I would be interested in the release EXE file size.
In that case it becomes 6.50K, but it won't start without "MSVCR100.DLL" on my XP or Vista without VS 2010 installed. And I'm sure there're more dependencies to it so if you add all of them up it will total to 1.5MB or even worse. On Win2K though it still results in the same "not a valid win32 application" error.
On the side note, I link my code statically since otherwise you'll have to install DLLs anyway, which is a pain in the neck by itself. So why doing it?
OK, one more test. The same console app with MFC compiled on MS VS 2008 (without SP1) weighs only 208K and does run on Windows 2000. So go figure what MS is trying to sell us?
So, guys, don't rush to convert your projects. It may come with a caveat...
-
July 17th, 2010, 07:09 PM
#6
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by ahmd
In that case it becomes 6.50K, but it won't start without "MSVCR100.DLL" on my XP or Vista without VS 2010 installed. And I'm sure there're more dependencies to it so if you add all of them up it will total to 1.5MB or even worse. On Win2K though it still results in the same "not a valid win32 application" error.
Ah, yes, that is about the file size I had expected in that case.
The name MSVCR100.DLL looks to me as if it refers to the basic (funny term in that context, isn't it? ) VC++ runtime. The ones of them I have on my system for older VC++ versions range from 60 kB (how could they ever get it that small?) to 340 kB. The MFC runtime DLLs used to have names like MFC42.DLL and all have sizes slightly below 1 MB on my system. (Not counting the ones with similar names that obviously contain localisation stuff and are much smaller.)
The massive file size bloat you observed when linking your "Hello world!" statically to MFC is some kind of mystery to me. I really can't imagine that all the MFC functions in total have dependecies on one another. The only other reason I can think of is that they all reside in a single obj module what IMO would imply that they have all been in a single compilation unit. And that is definitely not the recommended way to go.
On the side note, I link my code statically since otherwise you'll have to install DLLs anyway, which is a pain in the neck by itself. So why doing it?
Doesn't that pro edition have a tool that builds installation packages for you? I think earlier versions had. In that case it shouldn't be too much pain, at least not to the developer. But I have read in another thread these days that MS re-introduced a thing called "XCopy distribution strategy" (or something similar) together with VS 2010. This would mean, according to that thread, that all these DLLs get installed in the app directory instead of %windir%\system32. So linking dynamically wouldn't even save disk space. (Ok, you would save some space if your app is comprised of more than one EXE.) Maybe I'll dig that thread out at the end of this "CG pass" I'm in right now and post a question about that there.
EDIT: The correct term for what I was talking about appears to be XCopy deployment model. The thread containing the discussion about that topic is here and the relevant postings start at post #7. This post also has a link to MSDN that clarifies things a bit. In particular that MSDN article says that the XCopy deployment model is only one of three options when linking dynamically. (Of course it says a lot more, but that was the core point I got there.)
So go figure what MS is trying to sell us?
Oh, they try to sell us lots of stuff! In a recent magazine article I read a speculation that MS might discontinue VBA in the future, making us want to buy their full-blown developer tools for that purpose. (That speculation was based on the fact that VBA hasn't been extended while changing from Office 2007 to Office 2010.) And you can bet you couldn't use the VS Express Editions for that...
Last edited by Eri523; July 17th, 2010 at 08:53 PM.
-
August 5th, 2010, 01:15 PM
#7
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by ahmd
2. Then if I do pretty much the same, Win32 console app with MFC and use the following lines:
Code:
CString s;
s.Format(_T("Hello world!\n"));
_tprintf(s);
The size of the Release Unicode x86 build (with statically linked MFC libraries) mushrooms to, get ready for this, 1.54MB!!! Just for those 3 lines of code and a sh*t ton of MFC stuff that will never be used in this project. And obviously it doesn't run on Win2K either.
All that is BAD!
To address the static MFC size issue problem (not the Win2K problem) if you haven't already seen this, I thought I'd mention it. It will shrink your static MFC app back down to more reasonable size. See:
http://tedwvc.wordpress.com/2010/05/...visual-c-2010/
-
August 5th, 2010, 03:06 PM
#8
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Originally Posted by Ted.
To address the static MFC size issue problem (not the Win2K problem) if you haven't already seen this, I thought I'd mention it.
Yeah, thanks. But I made my decision already. VS2010 is not worth it (at this point in time). It's way overblown and doesn't add much vs. VS 2008 w/o SP1. So I decided to stick with the latter one and quite like it (no need to adjust every single MFC project I make). Maybe in a couple of years when Windows 2000 support and the size of code don't matter anymore, I'd go with a new version of VS. I think Microsoft made a big mistake by doing all this with the Visual Studio, they clearly needed a switch to leave out all that new stuff.
Last edited by ahmd; August 5th, 2010 at 05:09 PM.
-
November 8th, 2010, 07:37 AM
#9
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
I dealt with the spin-off question earlier (EXE size). Now back to the original question - Visual C++ 2010 on Windows 2000 - here is my solution:
http://tedwvc.wordpress.com/2010/11/...-windows-2000/
-
July 17th, 2010, 07:13 AM
#10
Re: MS Visual Studio 2010 and support for Windows 9x and 2000
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|