Support for Windows Mobile 5 and .NetCF 2.0

PDA Requirements:
-         Windows Mobile 5 operating system
-         .Net Compact Framework v2.0
-         Widcomm Bluetooth stack version 1.6 or later

Development Requirements:
-         Visual Studio 2005

What’s New
Due to a variety of build problems for WM5 (see below!) many of our internal files had to change.  To allow us to have the same code across all platforms we also changed some of the same files for the older platforms.  The new files are in the BTAccessMobileWM5.zip file in the evaluation kit.

You can still use the older files for the existing platforms if you like.  But do NOT use the WM5 files on older PocketPC/Windows Mobile PDAs, or on PDAs that are not running .NetCF v2.0, or on PDAs that are not running at least v1.6 of the Widcomm Bluetooth stack.

 Changed files include:
-         BTAccess.dll (C++ dll now built with Visual Studio 2005)
-         BTAccess.h, BTAccessDefs.h, BTflat.h
-         BTAccess.cs
-         BTAccessNet.dll
-         StackDemoNet source code project

C# Developers Notes
The StackDemoNet project (which includes the BTAccess.cs C# file) has not changed considerably.  We did add support for the new SearchComplete event, which you get when a StartDeviceSearch has ended (usually about 15 seconds after it starts).  See details in the BTAccess.cs file in the source code. When you get this event you can ignore it or decide to restart the search.

Otherwise the only difference from previous versions is that this version is now packaged as a Visual Studio 2005 project.

C++ Developers Notes
We tried for a long time to use eVC++ v4.0 to rebuild our legacy BTAccess C++ for the Windows Mobile 5 platform and the newest Widcomm Bluetooth stack, without success.  Then after an even longer struggle with Visual Studio 2005 we finally got it working.  If you too need to continue building C++ for the WM5 platform here are a few tips that might be useful:

  1. You can’t use eVC++ v4.0 to build C++ apps for WM5.  You must use Visual Studio 2005.
     
  1. You CAN use Visual Studio 2005 to build C++ apps for PocketPC2003/Windows Mobile, but remember to select that target when you create the project.   
     
  1. Don’t try to convert your application by bringing it up in Visual Studio 2005.  Instead create a brand new project and add the files you need as required.
     
  1. Be SURE to mark the new C++ project as using the “MFC static library” instead of the usual shared library.  The default is now static.  This of course makes your final .exe file very big since it includes MFC.  Refer to this article for some more information on this problem:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppcgen/html/compare_static_dynamic_link.asp

You could still use the shared dlls for MFC, but be aware that

  1. They are NOT any longer in ROM on the newer PDAs and must be downloaded or added to your installer package (so you don’t really use up any more disk space by statically linking)
  2. Visual Studio will automatically download them to your PDA during a “deploy” operation, but they are NOT put in the same location as your target location for your program.  Refer to the Project Properties to see the “Additional Files”, which are all prefixed with the “%...%” directory names.  For example the default for program XYZ is to put it and the additional files into /My Device/Program Files/XYZ directory.
  3. If you forget to do the above you will get one or more of the following very cryptic error messages:
  • This application requires a trusted certificate

  •    One or more components for the application cannot be found

  •     This is not a valid PocketPC application