I am going to take a detour and talk about something closer to home. As I stated before, I am now in the VSD team and we have shipped a set of tools and libraries in VS 2005 to make the life of device developers easier. However, this is turning out to be easier said than done. While we have shipped a really good development tool, the amount of support in the development environment to people with existing applications built on legacy tools is not perfect. I think that as a product team, we made the right decisions and achieved a fair degree of balance in this space to bring more power to the device developer to build really useful and powerful applications with new features in addition to helping people move over to the newer toolset as well. But, there is more that we can do to help people upgrade and that is the purpose of this blog and succeeding ones.
When I started going through the community posts, as expected, we had a series of questions on upgrading from eVC 4.0 to VS 2005. The upgrade wizard that is shipped with VS2005 is not the most visible feature though it really takes a major load off the upgrade scenario for mundane things like setting project flags and other things that you as a developer should not really be worrying about. The interesting (okay not so perfect) issue with this tool is that it does not automatically enable VS 2005 to recognize eVC 4.0 projects as something that can be upgraded making it a little harder to discover. Double-clicking on the vcw project file through the File Explorer does not do anything (or if you have eVC 4.0, it brings it up instead). You need to open the vcw file through VS 2005 for the upgrade wizard to kick in and do the appropriate conversion. It is also not very tolerant of changes to configuration strings in the eVC generated project file as can be seen from the following forum post.
The project consists entirely of configurations that require supp...
All said and done, this utility will help a lot in reducing the pain in upgrading to VS 2005 and is really useful.
While the project settings are upgraded in a manner consistent with the newer tools (like the compilers and libraries) in VS 2005, there are some differences which could block you from successfully building and deploying your applications in Whidbey. A couple of the most common differences which are a little hard to trace are listed in the blog posts below.
Error LNK2019 / error LNK2001: unresolved external symbol Linker errors for Device projects that use MFC and ATL libraries
Error LNK2019: unresolved external symbol
The other widespread question we as a team were asked was about the feasibility of MFC 3.0 applications on WM 5.0.
There are two aspects to the questions – if I am continuing to develop the application, what is my choice of the development environment?
Well, you have two choices depending on the application itself.
1) Upgrade to Visual Studio 2005. You use the entire MFC 8.0 libraries shipped with Whidbey. This upgrade will use the latest compilers, debugger, the WM 5.0 emulator and also the latest 8.0 libraries. VS 2005 supports development on WM 5.0 with this tool set completely and therefore is the best choice in the long run.
2) The second choice, which in my opinion is short-term is to use eVC 4.0 as the development environment whereas use VS 2005 to debug the application on WM 5.0. There are reasons why this might make sense in the immediate term. WM 5.0 has been around for a while now and the first round of devices is already appearing on the market soon. MFC 8.0 released just now and upgrading to MFC 8.0 from MFC 3.0 may take some time due to either dropped support for certain classes or compatibility issues between MFC 3.0 and MFC 8.0. Compatibility has been really important for our product team and we have tried hard to maintain it, but realistically speaking there will be a few issues – wish we could be perfect here though. While moving to the latest tools should be the long-term strategy, there might be reasons why there might be an immediate need to deploy on WM 5.0.
Here are the steps to debug MFC 3.0 applications on WM 5.0 using Visual Studio 2005.
1) Install eVC 4.0 SP4 and Visual Studio 2005 on the same machine.
2) Build the eVC 4.0 MFC project and copy the executable to the appropriate location on the device using Remote File Viewer from Visual Studio 2005.
3) Create a dummy project on Visual Studio 2005 (this must be an executable project) for the correct WM 5.0 platform.
4) In VS 2005, open the project properties page and navigate to the Debugging page. Set the Remote Executable to the eVC 4.0 application using the macros to specify the target directory.
5) F5 and things should just work.
There are other variations of this approach that will also work, but this should essentially enable you to continue development on the MFC 3.0 applications and target WM 5.0.
That brings us to the second aspect of the upgrade. Will the MFC 3.0 application work as expected on WM 5.0 with no recompilation or upgrade to the newer tools? Will the upgraded MFC 8.0 application work exactly like the MFC 3.0 application on WM 5.0? From an official point of view, MFC 3.0 on WM 5.0 is not a recommended scenario and we strongly recommend upgrading to the newer MFC 8.0. However, as I stated above, there might be considerations because of which you might want to continue with the MFC 3.0 application. The WIN CE operating system strives to achieve application compatibility at the binary level and things should work as expected. In reality though, there will be breaking changes which could cause your application and the libraries to not work making our task harder. We have also tried to make sure that the MFC 8.0 API is as close to the MFC 3.0 set while at the same time trying to unify the programming model between the desktop and the device. These considerations are often at the opposite ends of the spectrum and while we have achieved a sembalance of balance, it is likely that some applications are more painful to upgrade than others.
In the next blog, I will be talking about runtime issues of MFC 3.0 on WM 5.0 which will need to be understood to get the application working as expected. Hopefully, you should be able to upgrade and build your application with MFC 8.0 on Visual Studio 2005 and if you have any issues, you can use the Smart Devices Forum (http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=35) to post your queries and get going.