Search code examples
c#visual-studiovisual-studio-2008windows-mobilepocketpc

Why won't my program open on Pocket PC?


I am making a program in Visual Studio 2008 for my Pocket PC, but I can't get the program to open. I followed the instructions to create a cab file to install it on the device, but then when I try to click on the program its loads for half a second and then doesn't do anything. The program works fine in the emulator.


Solution

  • Are you really using a Pocket PC device? The Pocket PC terminology was last used in 2003. The platform has been called "Windows Mobile" since then. Not to be confused with "Windows 10 Mobile". Naming is not a strong point for Microsoft in this regard.

    You need to use the Pocket PC SDK if you are truly developing for a Pocket PC.

    If your application uses MFC then your program will depend on the MFC library to run. The simplest way to solve this problem is to link statically to MFC.

    1. Go to the Project Settings
    2. Go to the "General" tag page.
    3. Search for "Use of MFC" and select "Use MFC in a static library".
    4. Save & Rebuild the project. The size of your EXE is now larger because you have statically linked to MFC.

    If your application uses Compact Framework then your program will also depend on the .NET Compact Framework (CF) library to run. The simplest way to solve this problem is to include the CAB file(s) from your Visual Studio folder. Then you can run the CAB file to install .NET Compact Framework.

    1. Navigate to the "C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE\wce400\armv4" folder.
    2. Copy the "NETCFv2.ppc.armv4.cab" file to your device.
    3. On the device, navigate to the NETCFv2.ppc.armv4.cab file and click on it to install.

    You can read this for more information on the subject.