CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 35
  1. #16
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: MS Visual Studio 2010 and support for Windows 9x and 2000

    Quote Originally Posted by Paul McKenzie View Post
    To make the point more clear, create an EXE file, and drag it into Dependency Walker.
    OK. I knew you'd ask it. So here you go. Two projects:

    1. TestConsoleSize.exe
    No MFC
    Release Build (with MS VS 2010)
    Use standard Windows Libraries
    Size: 6.50 KB
    Code:
    	_tprintf(_T("Hello World!\n"));
    	getchar();
    2. TestConsoleSizeWithMFC.exe
    Same thing but With MFC
    Release Build (with MS VS 2010)
    Use MFC in a Static Library
    Size: 1.54 MB
    Code:
    	CString s;
    	s.Format(_T("Hello World!\n"));
    	_tprintf(s);
    	getchar();
    Attached Images Attached Images   

  2. #17
    Join Date
    Apr 1999
    Posts
    27,449

    Re: MS Visual Studio 2010 and support for Windows 9x and 2000

    Quote Originally Posted by ahmd View Post
    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.

    Regards,

    Paul McKenzie

  3. #18
    Join Date
    Apr 1999
    Posts
    27,449

    Re: MS Visual Studio 2010 and support for Windows 9x and 2000

    Quote Originally Posted by ahmd View Post
    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.

    Regards,

    Paul McKenzie

  4. #19
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: MS Visual Studio 2010 and support for Windows 9x and 2000

    Quote Originally Posted by Paul McKenzie View Post
    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.

    Quote 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?

  5. #20
    Join Date
    Apr 1999
    Posts
    27,449

    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.

  6. #21
    Join Date
    Apr 1999
    Posts
    27,449

    Re: MS Visual Studio 2010 and support for Windows 9x and 2000

    Quote Originally Posted by ahmd View Post
    Well, I guess that if you don't use MFC or ATL then you might be safe.
    That also depends. If you statically linked MFC, then maybe it's still safe.

    Regards,

    Paul McKenzie

  7. #22
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: MS Visual Studio 2010 and support for Windows 9x and 2000

    Quote Originally Posted by Paul McKenzie View Post
    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.

  8. #23
    Join Date
    Apr 1999
    Posts
    27,449

    Re: MS Visual Studio 2010 and support for Windows 9x and 2000

    Quote Originally Posted by ahmd View Post
    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.

    Regards,

    Paul McKenzie

  9. #24
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: MS Visual Studio 2010 and support for Windows 9x and 2000

    Quote Originally Posted by Paul McKenzie View Post
    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.

  10. #25
    Join Date
    Apr 1999
    Posts
    27,449

    Re: MS Visual Studio 2010 and support for Windows 9x and 2000

    Quote Originally Posted by ahmd View Post
    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.

    Regards,

    Paul McKenzie

  11. #26
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: MS Visual Studio 2010 and support for Windows 9x and 2000

    Quote Originally Posted by Paul McKenzie View Post
    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.

  12. #27
    Join Date
    Apr 1999
    Posts
    27,449

    Re: MS Visual Studio 2010 and support for Windows 9x and 2000

    Quote Originally Posted by ahmd View Post
    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.

    Anyway, here is the file.

    Regards,

    Paul McKenzie
    Attached Files Attached Files

  13. #28
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: MS Visual Studio 2010 and support for Windows 9x and 2000

    Quote Originally Posted by Paul McKenzie View Post
    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 ...
    Attached Images Attached Images  

  14. #29
    Join Date
    Apr 1999
    Posts
    27,449

    Re: MS Visual Studio 2010 and support for Windows 9x and 2000

    Quote Originally Posted by ahmd View Post
    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.

    Regards,

    Paul McKenzie

  15. #30
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: MS Visual Studio 2010 and support for Windows 9x and 2000

    Quote Originally Posted by Paul McKenzie View Post
    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.

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured