This topic describes how to use a C++ IDE to integrate a Windows SDK.
Prerequisites
- You can obtain an SDK and AccessKey pair for Windows from the GameShield console.
For more information, see Obtain an SDK package and AccessKey pair.
- You can obtain the following information from the GameShield console.
- GroupName: indicates a node group ID. Log on to the GameShield console, open the game
management page, and view the target node group ID on the Basic Settings tab.

- Protection Target ID. Log on to the GameShield console, open the Games page, and view
a protection target ID on the Protection Target Settings tab.

Procedure
- Open a C++ editor in Windows.
- Create a project of the Console App type. Name the project yxd_windows_sdk_test.

- Add dependencies to the libs directory.
- Create a directory named libs in the new project directory.
- Copy the YunCeng-WINDOWS.lib file that resides in the Windows SDK to the libs directory.
- Open the Property page of the project, choose , and add ./libs as an additional library directory.
- Choose , and add YunCeng.WINDOWS.lib as an additional dependency.
- Test the init method.
char appkey[] = "appkey";
eAlSdkRet ret = YunCeng_InitAlSdkEx(appkey, "Player ID");
if (ret ! = cAlSdkOK) {
printf("init sdk failed.\n");
return -1;
}
- Copy the .dll file to the directory where the project resides. Move YunCeng-WINDOWS.dll to the directory where the project executable file named yxd_windows_sdk_test.exe resides.

- Check whether you can obtain the IP address of a protection target.
//Call the key methods.
ip_len = 18
ip = create_string_buffer('/0' * ip_len)
port_len = 18
port = create_string_buffer('/0' * port_len)
ret = YunCeng_GetProxyTcpByDomain("Player ID", "GroupName", "Protection target ID", "Port for the protection target", ip, ip_len, port, port_len);
if (ret ! = cAlSdkOK) {
printf("get next ip failed.
\n");
} else {
printf("get
next ip success. %s %s\n", ip, port);
}