Creating an Application to Convert to IPv4/IPv6 (Windows Embedded CE 6.0)

1/6/2010

You can view the project you created in Creating a New Project for Converting to IPv4/IPv6. In the Solution Explorer window, expand Subprojects, and then navigate through the Projects tree to find your project.

After you complete the tasks in Creating a New Project for Converting to IPv4/IPv6, you are ready to perform this procedure.

You will use this same procedure to create both a server and a client application.

To create an application to convert to IPv4/IPv6

  1. In the Solution Explorer window, right-click on the subproject name, and choose Add, New Item.
    The Add New Item dialog box appears.

  2. Perform the following steps:

    1. Choose the code category.
    2. Choose C++ File (.cpp).
    3. For file name, type CeClientApp or CeServerApp, depending on the type of application you are creating.
    4. Choose Add.
  3. In the Solution Explorer window, expand Subprojects, expand the <Subproject name> node, and then expand Source files.

  4. Open the appropriate source file, CeClientApp.cpp or CeServerApp.cpp.

  5. Replace the information in source file with the sample code as shown in the following table.

    Code sample Description

    IPv4-only Client Code

    Opens a TCP port connection on port 1234, and then sends an English text string to the server.

    IPv4-only Server Code

    Responds to the client by echoing the packet, and then closes the port.

  6. On the File menu, choose Save.

  7. In the Solution Explorer window, in the Subprojects node, choose the project: SimpleClient or SimpleServer.

  8. Right-click on the project, and choose Properties.
    The Editing <project path> dialog box appears.

  9. On the C/C++ tab, perform the following steps:

    1. For Executable Entry Point, type the name of the entry point for the application. In this example, type mainWCRTStartup.
      For more information about executable entry points, see EXEENTRY.
    2. For Precompiled Files, type No.
    3. Remove any files listed in any of the Precompiled Header text boxes.
  10. On the General tab, make sure that Target Type is set to Executable Application.

  11. On the Link tab, for Additional Libraries, add the ws2.lib.

    Note

    This example uses two libraries: ws2.lib provides Winsock functions that you need in network applications; coredll.lib provides the core functionality that an application needs. You must separate the two entries with a space and enter the entire path. The path to ws2.lib is the same as the path to coredll.lib. You can copy the existing path.

  12. Choose OK.

  13. In the Solution Explorer window, choose the SimpleClient or SimpleServer project.

  14. From the Build menu, choose Targeted Build Settings, and then select Make Run-Time Image after Building.

  15. In the Solution Explorer window, right-click the project and choose Build.

See Also

Tasks

How to Convert an Application from IPv4 to IPv4/IPv6