views:

39

answers:

2

I'm using Microsoft Visual Studio 2008 (VC9) to compile a project that has a .dsw file. I already have the 2010 and would prefer to use it, but it seems this dsw was built for 2008.

I'd like to compile and produce a binary that's also compatible with Windows 7. My questions:

  • if I compile with 2008, will the resulting binary be compatible with Windows 7? I'm not sure at which version of VS did Windows 7 support start.
  • or does this have nothing to do with the VS version, and is instead related to the Windows SDK? If that's the case, can I use VS2008 with a newer Windows SDK?

Can someone please clarify.

+5  A: 

Microsoft has a great backwards compatibility "story", so pretty much anything you compile with any version of Visual Studio/Visual C++ will be compatible with Windows 7. The same may not neccessarily apply in reverse, i.e. if you use an API that's introduced in Windows 7, your application will error when you try to run it on prior versions of Windows.

There are a couple of things to consider though:

  • If the project was originally written to target Windows XP or earlier, it may fall foul of UAC
  • There are changes to directory structures (such as %systemdrive%\Documents and Settings becoming %systemdrive%\Users) that are fairly well handled by the link that Windows 7 creates in the root of `%systemdrive%, but you may fall foul of these.
Rob
Ultimately though, if you are wanting to ensure that your code will run on Win7 you will need to test it. It's likely to run, but you may come across problems with UAC, registry virtualisation, manifests, etc. Try downloading the Application Compatibility Toolkit and run your program through it, which will highlight problem areas such as writing to privileged file/registry areas.
the_mandrill
"you may come across problems with UAC, registry virtualisation, manifests" - only if you've not made the effort to write your software to not require administrative privileges from the start.
Rob
+2  A: 

VS2010 includes version 7.0 of the Windows SDK and VS2008 does not. You need Windows SDK v7.0 if you want your app to take advantage of Windows 7 features like jump lists.

Since you already have VS2010 installed, you can just change your include file / lib file paths in VS2008 to point to the Windows SDK v7.0 instead of the default one provided with VS2008. This is assuming you need that version of the SDK.

You do not need the latest Windows SDK if you do not plan to use the latest Windows 7 features like ribbons and jump lists. If you are building your app for the lowest-common-denominator OS (i.e. Windows XP), then really you should be fine using VS 2008 with default settings.

The other concern is, if your code was originally written before Windows Vista came out, it is likely that it will not work properly on Windows 7 unless it is run in Administrator mode, which is something you want to avoid. The only way to fix that is to rewrite much of your code to avoid writing to certain protected directories and avoid using certain APIs that require Administrator privileges.

dacris