Thursday, July 16, 2009

Converting VC8 Solution To VC9

Ok, so I installed VS 2008 (see previous post). Were there any complications involved? Not really. Only 1 major and 1 minor. First, since I wanted to keep all vc8 projects and solutions, I copied all vc8-projects & vc8-solutions and renamed the copies to *_vc9.proj & *_vc9.sln. Then I edited all vc9.sln files to use vc9.proj files instead of the vc8.proj files. I fired up vc9.sln and VS converted the solution and the project files without problems. All fine. Was I able to build the solution? No.

There were 1 warning and 1 error. The warning was easy. It was the warning about wp64 (the option which checks for 64-bit compatibility issues) have been deprecated. All I had to do to remove this warning was to disable 64bit compatibility check in the projects options (It's deprecated anyway. You should build in 64-bits mode instead).

The error I got was from the resource compiler. I have used the resource editor and some Win32 API programming to show some simple editor dialogs in the game. When I installed VS2005 I included the MFC files which enables you to use MFC. Since I have never used MFC (I use the core Win32 API instead) I did not include it when I installed VS2008. What I didn't know (and what I think is a bug(?) from Microsoft) is that the resource editor includes a dependency on "afxres.h" in your resource file. This "afxres.h" only gets included in your install when you choose to install MFC. The solution to fix this (I do not want to install MFC) is to copy 2 files from the MFC dir of VS2005 to the same dir in VS2008.
  • VS8\VC\atlmfc\include\afxres.h -> VS9\VC\atlmfc\include\afxres.h
  • VS8\VC\atlmfc\include\winres.h -> VS9\VC\atlmfc\include\winres.h

No comments:

Post a Comment