Книга: Microsoft Windows Embedded CE 6.0 Exam Preparation Kit

Cloning Public Code

Cloning Public Code

Platform Builder supports instant cloning for some Windows Embedded CE components. To clone these components, right-click the catalog item in the Catalog Items View of Solution Explorer and select Clone Catalog Item. Platform Builder will automatically create a subproject for the component you selected in your OS design with a copy of the code. Before using any other method, such as the Sysgen Capture tool, you should check to see if the desired catalog component supports the Clone Catalog Item option. If it does, then you are two mouse-clicks from completion, as illustrated in Figure 1-5.


Figure 1-5 Cloning a catalog item

If you cannot automatically clone a component by using the IDE, you have to do it manually. However, when you look at the sources file for a .dll or .exe file in the Public directory tree, you see that this file is not the same as the sources file in your platform directory or in a subproject directory. This is because the build process for the Public directory tree differs from the BSP build process. All the build instructions are defined in the makefile file, which is always located in the same directory as the associated sources file. The Public directory tree must support the Sysgen phase, where the required components are linked together relatively.

Converting a component from the Public directory tree to a BSP component or a sub- project requires a number of steps, which are outlined in detail in the Platform Builder for Microsoft Windows Embedded CE product documentation under "Using the Sysgen Capture Tool" at http://msdn2.microsoft.com/en-us/library/aa924385.aspx.

Basically, you need to perform the following steps:

1. Copy the code of the desired Public component into a new directory.

2. Edit the sources file in the new directory and add the line RELEASETYPE=PLATFORM or change the value to PLATFORM if the line already exists so that the build engine places the output from this build into the %_TARGETPLATROOT% folder.

3. Add WINCEOEM=1 to the sources file and build the component in the new directory. This might require further modifications to resolve all build errors.

4. Use the Sysgen Capture tool to create modular sources and dirs files.

5. Rename and use the files created by the Sysgen Capture tool along with a makefile to rebuild the new cloned module.

Once you apply all required modifications to the cloned component, you can modify and redistribute it as easily as any other code.

Оглавление книги


Генерация: 1.074. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз