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
In the Solution Explorer window, right-click on the subproject name, and choose Add, New Item.
The Add New Item dialog box appears.Perform the following steps:
- Choose the code category.
- Choose C++ File (.cpp).
- For file name, type CeClientApp or CeServerApp, depending on the type of application you are creating.
- Choose Add.
In the Solution Explorer window, expand Subprojects, expand the <Subproject name> node, and then expand Source files.
Open the appropriate source file, CeClientApp.cpp or CeServerApp.cpp.
Replace the information in source file with the sample code as shown in the following table.
Code sample Description Opens a TCP port connection on port 1234, and then sends an English text string to the server.
Responds to the client by echoing the packet, and then closes the port.
On the File menu, choose Save.
In the Solution Explorer window, in the Subprojects node, choose the project: SimpleClient or SimpleServer.
Right-click on the project, and choose Properties.
The Editing <project path> dialog box appears.On the C/C++ tab, perform the following steps:
- 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. - For Precompiled Files, type No.
- Remove any files listed in any of the Precompiled Header text boxes.
- For Executable Entry Point, type the name of the entry point for the application. In this example, type mainWCRTStartup.
On the General tab, make sure that Target Type is set to Executable Application.
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.
Choose OK.
In the Solution Explorer window, choose the SimpleClient or SimpleServer project.
From the Build menu, choose Targeted Build Settings, and then select Make Run-Time Image after Building.
In the Solution Explorer window, right-click the project and choose Build.