How to add x64 build configurations to a Visual Studio 2005 solution
Last week, a customer asked me a question about the FileWriter MSAS sample application that ships in the Windows Media Center SDK for Windows Vista. This customer was running an x64 build of Windows Vista and could not get FileWriter to correctly create a log file when they built and ran it. After some investigation, we discovered that the customer was compiling a 32-bit version of this binary, and it was failing to work as expected because all of the COM objects that it was attempting to interact with are only registered in the native 64-bit registry on x64 builds of Windows Vista.
We were able to resolve this issue by building a native x64 version of this binary. Unfortunately, we did not include an x64 build configuration in the FileWriter sample application Visual Studio project/solution files. However, you can manually add x64 build configurations in order to enable this scenario in the Windows Media Center SDK for Windows Vista RC1 or RC2.
Before these steps will work, you need to make sure that you have the Visual Studio 2005 x64 compilers and tools installed. This feature is available in the Visual Studio 2005 setup UI under the Visual C++ language tools node, but it is unchecked by default. If you performed a default install of Visual Studio 2005, you will need to go to Add/Remove Programs, enter Visual Studio 2005 setup maintenance mode and add the x64 compilers and tools feature.
Once you have this feature installed, you can use the following steps in the Visual Studio 2005 IDE in order to add x64 build configurations and then build a native x64 version of the FileWriter sample application:
- Open the FileWriter solution in Visual Studio 2005
- From the Build menu, choose Configuration Manager...
- In the Active solution platform, choose <New...> to bring up the New Solution Platform dialog
- In the Type or select the new platform dialog, choose x64
- Click OK in the New Solution Platform dialog to add x64 configurations to your solution
- From the Build menu, choose Batch Build... and you should now see Debug | x64 and Release | x64 configurations available
- If you do not see an x64 option in the Type or select the new platform dialog in step 4 above, that means you do not have the x64 compilers and tools feature installed for Visual Studio 2005.
- You must have Visual Studio 2005 standard or higher installed in order to build the FileWriter project. It requires some advanced options that are not available in the Visual C++ 2005 Express Edition.
We have fixed the FileWriter solution and project files for the Windows Media Center SDK and this fix will be included in the final release of the SDK. In the meantime, I have posted updated vcproj and sln files for the FileWriter sample that you can copy onto your system that has the Windows Media Center SDK for Windows Vista RC1 or RC2 if you would like to avoid manually configuring the solution/project files using the above steps.