The WinCE Platform program compiles to the Win32 platform to run

Source: Internet
Author: User

In the recent project, there was a program running on the WinCE platform, and later with the development of the project, the program was required to run on the PC as well.
Thanks to the multi-platform support offered by VS 2005, this problem can be solved in just a few minutes, the method is simple, and the following is the process I am dealing with. 1. Add a new platform in configuration Management 1.1 create a new platform

The program was originally created on the Pocket PC 2003 (ARMV4) platform, and I created a new WIN32 platform based on the configuration of this platform.
Open the menu build->configuration Manager, select New in the Active solution platform drop-down selection box, select New platform as win32,copy settings From the original configuration of the Pocket PC 2003 (ARMV4), press OK to create a new Win32 run platform for the application. 1.2 Modifying Debug| Configuration of the Win32

The configuration of the Win32 platform is replicated by PPC, and some parameters need to be changed. You can make modifications in the project properties, but it may be more straightforward and straightforward to modify the project file directly, and I will modify the file directly.

1.2.1 Modify the predefined macro preprocessordefinitions in tool VCMidlTool, leaving only "_DEBUG"
1.2.2 Modify the predefined macro preprocessordefinitions in tool VCMidlTool, change to "_DEBUG; Win32;_windows "
1.2.3 Modify the predefined macro preprocessordefinitions in tool VCResourceCompilerTool, leaving only "_DEBUG"
1.2.4 Modify the configuration of the tool VCLinkerTool, instead

    1. <tool
    2. Name= "VCLinkerTool"
    3. Linkincremental= "2"
    4. Generatedebuginformation= "true"
    5. Subsystem= "2"
    6. Targetmachine= "1"
    7. />
1.3 Modifying release| Configuration of the Win32

1.3.1 Modify the predefined macro preprocessordefinitions in tool VCMidlTool, leaving only "Ndebug"
1.3.2 Modify the predefined macro preprocessordefinitions in tool VCMidlTool, change to "NDEBUG; Win32;_windows "
1.3.3 Modify the predefined macro preprocessordefinitions in tool VCResourceCompilerTool, leaving only "Ndebug"
1.3.4 Modify the configuration of the tool VCLinkerTool, instead

    1. <tool
    2. Name= "VCLinkerTool"
    3. Linkincremental= "1"
    4. Generatedebuginformation= "true"
    5. Subsystem= "2"
    6. Optimizereferences= "2"
    7. Enablecomdatfolding= "2"
    8. Targetmachine= "1"
    9. />
2. Fix compiler errors caused by platform differences 2.1 stdafx.h

The first is the definition of winver, wince under the definition of _WIN32_WCE, change:

    1. #if defined (WINCE)
    2. #define WINVER _win32_wce
    3. #else
    4. #define WINVER 0x0501//allows the use of features specific to Windows XP or later.
    5. #endif

Then there are some wince-specific header files and libraries that, instead, are compiled only when wince macros are defined (possibly scattered in different locations):

    1. #if defined (WINCE)
    2. #include <ceconfig.h>
    3. #include <altcecrt.h>
    4. #include <aygshell.h>
    5. #pragma comment (lib, "Aygshell.lib")
    6. #endif

2.2 App Class

In Xxxapp::initinstance, the call to Shinitextracontrols () plus macro detection is compiled only if the WinCE macro is defined.

    1. #if defined (WINCE)
    2. Shinitextracontrols should be called once during your application ' s initialization-initialize any
    3. Of the Windows Mobile specific controls such as CAPEDIT and Sippref.
    4. Shinitextracontrols ();
    5. #endif

In addition, the application class header file contains the definition of the resource file, but was #ifdef Pocketpc2003_ui_model macro wrapped up, my program in two platforms all use the same resources, so this macro comment out.

Reference Link: http://blog.sina.com.cn/s/blog_7ffab91701016o5o.html

Http://wenku.baidu.com/link?url= Hhgo7jtpvedk3prtyofxxjeanbijk8g6k57coqanvrdu2evyerzu7om3foczqo63bg3ds3b28ij420k1pjiath7ojovjnin6mosk6p3wxdk

The WinCE Platform program compiles to the Win32 platform to run

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.