Skip to content

Commit ff4f1d0

Browse files
committed
update:support x64 build for example
1 parent f36763a commit ff4f1d0

File tree

14 files changed

+256
-211
lines changed

14 files changed

+256
-211
lines changed

XEngine_APPClient/APPClient_Download/APPClient_Download.cpp

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
#ifdef _MSC_BUILD
66
#include <windows.h>
77
#include <tchar.h>
8-
#pragma comment(lib,"x86/XEngine_BaseLib/XEngine_BaseLib")
9-
#pragma comment(lib,"x86/XEngine_NetHelp/NetHelp_APIClient")
10-
#pragma comment(lib,"x86/XEngine_SystemSdk/XEngine_SystemApi")
8+
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
9+
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient")
10+
#pragma comment(lib,"XEngine_SystemSdk/XEngine_SystemApi")
1111
#pragma comment(lib,"Ws2_32")
12+
#ifdef _WIN64
13+
#pragma comment(lib,"../../XEngine_Source/x64/Debug/jsoncpp")
14+
#else
1215
#pragma comment(lib,"../../XEngine_Source/Debug/jsoncpp")
16+
#endif
1317
#else
1418
#endif
1519
#include <list>
@@ -29,19 +33,19 @@
2933
using namespace std;
3034

3135
//需要优先配置XEngine
32-
//WINDOWS使用VS2022 x86 debug 编译
36+
//WINDOWS使用VS2022 x86 或者 x64 debug 编译
3337
//linux::g++ -std=c++17 -Wall -g APPClient_Download.cpp -o APPClient_Download.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -L /usr/local/lib/XEngine_Release/XEngine_SystemSdk -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIClient -lXEngine_SystemApi -ljsoncpp
3438
//macos::g++ -std=c++17 -Wall -g APPClient_Download.cpp -o APPClient_Download.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIClient -lXEngine_SystemApi -ljsoncpp
3539

3640
typedef struct
3741
{
3842
XENGINE_PROTOCOL_FILE st_ProtocolFile;
39-
CHAR tszBuckKey[128];
40-
CHAR tszIPAddr[64];
43+
XCHAR tszBuckKey[128];
44+
XCHAR tszIPAddr[64];
4145
}P2PFILE_INFO;
4246

4347
//解析局域网中所有文件
44-
void P2PParse_List(LPCTSTR lpszMsgBuffer, int nMsgLen, list<P2PFILE_INFO>* pStl_ListFile)
48+
void P2PParse_List(LPCXSTR lpszMsgBuffer, int nMsgLen, list<P2PFILE_INFO>* pStl_ListFile)
4549
{
4650
Json::Value st_JsonRoot;
4751
Json::CharReaderBuilder st_JsonBuild;
@@ -64,13 +68,13 @@ void P2PParse_List(LPCTSTR lpszMsgBuffer, int nMsgLen, list<P2PFILE_INFO>* pStl_
6468
memset(&st_P2PFile, '\0', sizeof(P2PFILE_INFO));
6569

6670
st_P2PFile.st_ProtocolFile.nFileSize = st_JsonArray[i]["nFileSize"].asInt();
67-
_tcscpy(st_P2PFile.st_ProtocolFile.tszFileHash, st_JsonArray[i]["tszFileHash"].asCString());
68-
_tcscpy(st_P2PFile.st_ProtocolFile.tszFileName, st_JsonArray[i]["tszFileName"].asCString());
69-
_tcscpy(st_P2PFile.st_ProtocolFile.tszFilePath, st_JsonArray[i]["tszFilePath"].asCString());
70-
_tcscpy(st_P2PFile.st_ProtocolFile.tszFileTime, st_JsonArray[i]["tszFileTime"].asCString());
71-
_tcscpy(st_P2PFile.st_ProtocolFile.tszFileUser, st_JsonArray[i]["tszFileUser"].asCString());
72-
_tcscpy(st_P2PFile.tszIPAddr, st_JsonArray[i]["tszTableName"].asCString());
73-
_tcscpy(st_P2PFile.tszBuckKey, st_JsonArray[i]["tszBuckKey"].asCString());
71+
_tcsxcpy(st_P2PFile.st_ProtocolFile.tszFileHash, st_JsonArray[i]["tszFileHash"].asCString());
72+
_tcsxcpy(st_P2PFile.st_ProtocolFile.tszFileName, st_JsonArray[i]["tszFileName"].asCString());
73+
_tcsxcpy(st_P2PFile.st_ProtocolFile.tszFilePath, st_JsonArray[i]["tszFilePath"].asCString());
74+
_tcsxcpy(st_P2PFile.st_ProtocolFile.tszFileTime, st_JsonArray[i]["tszFileTime"].asCString());
75+
_tcsxcpy(st_P2PFile.st_ProtocolFile.tszFileUser, st_JsonArray[i]["tszFileUser"].asCString());
76+
_tcsxcpy(st_P2PFile.tszIPAddr, st_JsonArray[i]["tszTableName"].asCString());
77+
_tcsxcpy(st_P2PFile.tszBuckKey, st_JsonArray[i]["tszBuckKey"].asCString());
7478

7579
pStl_ListFile->push_back(st_P2PFile);
7680
}
@@ -82,7 +86,7 @@ typedef struct
8286
__int64x nPosStart;
8387
__int64x nPosEnd;
8488
}P2PFILE_PIECE;
85-
void P2PFile_Create(list<P2PFILE_INFO>* pStl_ListFile, LPCTSTR lpszFile)
89+
void P2PFile_Create(list<P2PFILE_INFO>* pStl_ListFile, LPCXSTR lpszFile)
8690
{
8791
P2PFILE_PIECE* pSt_P2PFile = new P2PFILE_PIECE[pStl_ListFile->size()];
8892

@@ -93,38 +97,38 @@ void P2PFile_Create(list<P2PFILE_INFO>* pStl_ListFile, LPCTSTR lpszFile)
9397
list<P2PFILE_INFO>::const_iterator stl_ListIterator = pStl_ListFile->begin();
9498
for (int i = 0; stl_ListIterator != pStl_ListFile->end(); stl_ListIterator++, i++)
9599
{
96-
TCHAR tszDLUrl[1024];
97-
TCHAR tszRange[128];
100+
XCHAR tszDLUrl[1024];
101+
XCHAR tszRange[128];
98102

99103
memset(tszDLUrl, '\0', sizeof(tszDLUrl));
100104
memset(tszRange, '\0', sizeof(tszRange));
101105

102-
_stprintf(tszDLUrl, _T("%s/%s/%s"), stl_ListIterator->tszIPAddr, stl_ListIterator->tszBuckKey, stl_ListIterator->st_ProtocolFile.tszFileName);
106+
_xstprintf(tszDLUrl, _X("%s/%s/%s"), stl_ListIterator->tszIPAddr, stl_ListIterator->tszBuckKey, stl_ListIterator->st_ProtocolFile.tszFileName);
103107
//是否是最后一块
104108
if ((int)pStl_ListFile->size() == (i + 1))
105109
{
106110
pSt_P2PFile[i].nPosStart = nPos;
107111
pSt_P2PFile[i].nPosEnd = 0;
108-
_stprintf(tszRange, _T("%lld-"), pSt_P2PFile[i].nPosStart);
112+
_xstprintf(tszRange, _X("%lld-"), pSt_P2PFile[i].nPosStart);
109113
}
110114
else
111115
{
112116
pSt_P2PFile[i].nPosStart = nPos;
113117
pSt_P2PFile[i].nPosEnd = nPiece;
114118
nPos += nPiece;
115-
_stprintf(tszRange, _T("%lld-%lld"), pSt_P2PFile[i].nPosStart, pSt_P2PFile[i].nPosEnd);
119+
_xstprintf(tszRange, _X("%lld-%lld"), pSt_P2PFile[i].nPosStart, pSt_P2PFile[i].nPosEnd);
116120
}
117-
pSt_P2PFile[i].xhToken = APIClient_File_Create(tszDLUrl, lpszFile, TRUE, tszRange);
121+
pSt_P2PFile[i].xhToken = APIClient_File_Create(tszDLUrl, lpszFile, true, tszRange);
118122
if (NULL == pSt_P2PFile[i].xhToken)
119123
{
120-
printf("create download task is failed:%X\n", APIClient_GetLastError());
124+
_xtprintf("create download task is failed:%X\n", APIClient_GetLastError());
121125
}
122126
APIClient_File_Start(pSt_P2PFile[i].xhToken);
123127
}
124128
//直到所有完成
125129
while (1)
126130
{
127-
BOOL bComplete = TRUE;
131+
bool bComplete = true;
128132
for (unsigned int i = 0; i < pStl_ListFile->size(); i++)
129133
{
130134
NETHELP_FILEINFO st_TaskInfo;
@@ -135,7 +139,7 @@ void P2PFile_Create(list<P2PFILE_INFO>* pStl_ListFile, LPCTSTR lpszFile)
135139
{
136140
bComplete = FALSE;
137141
}
138-
printf("DLToken:%p DLTotal:%lf DLNow:%lf DLStatus:%d\n", pSt_P2PFile[i].xhToken, st_TaskInfo.dlTotal, st_TaskInfo.dlNow, st_TaskInfo.en_DownStatus);
142+
_xtprintf("DLToken:%p DLTotal:%lf DLNow:%lf DLStatus:%d\n", pSt_P2PFile[i].xhToken, st_TaskInfo.dlTotal, st_TaskInfo.dlNow, st_TaskInfo.en_DownStatus);
139143
}
140144
if (bComplete)
141145
{
@@ -161,22 +165,22 @@ int main()
161165

162166
int nHTTPCode = 0;
163167
int nBodyLen = 0;
164-
TCHAR *ptszMsgBody = NULL;
168+
XCHAR *ptszMsgBody = NULL;
165169
//请求分布式存储文件所有位置
166-
LPCTSTR lpszUrl = _T("http://127.0.0.1:5100/Api/Manage/Query");
167-
LPCTSTR lpszFile = _T("D:\\XEngine_Storage\\XEngine_APPClient\\Debug\\qq.exe");
170+
LPCXSTR lpszUrl = _X("http://127.0.0.1:5100/Api/Manage/Query");
171+
LPCXSTR lpszFile = _X("D:\\XEngine_Storage\\XEngine_APPClient\\Debug\\qq.exe");
168172

169173
Json::Value st_JsonRoot;
170174
st_JsonRoot["nMode"] = 1; //使用P2P下载
171175
st_JsonRoot["lpszBuckKey"] = "storagekey2";
172176
//st_JsonRoot["lpszFileName"] = "qq.exe";
173177
st_JsonRoot["lpszFileHash"] = "781E5E245D69B566979B86E28D23F2C7";
174178

175-
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nHTTPCode, &ptszMsgBody, &nBodyLen))
179+
if (!APIClient_Http_Request(_X("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nHTTPCode, &ptszMsgBody, &nBodyLen))
176180
{
177181
return -1;
178182
}
179-
printf("%s\n", ptszMsgBody);
183+
_xtprintf("%s\n", ptszMsgBody);
180184

181185
list<P2PFILE_INFO> stl_ListFile;
182186
P2PParse_List(ptszMsgBody, nBodyLen, &stl_ListFile);

XEngine_APPClient/APPClient_Download/APPClient_Download.vcxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,15 @@
7373
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7474
<LinkIncremental>true</LinkIncremental>
7575
<IncludePath>$(XEngine_Include);../../XEngine_Source/XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
76-
<LibraryPath>$(XEngine_Library);$(LibraryPath)</LibraryPath>
76+
<LibraryPath>$(XEngine_Lib32);$(LibraryPath)</LibraryPath>
7777
</PropertyGroup>
7878
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
7979
<LinkIncremental>false</LinkIncremental>
8080
</PropertyGroup>
8181
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
8282
<LinkIncremental>true</LinkIncremental>
83+
<IncludePath>$(XEngine_Include);../../XEngine_Source/XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
84+
<LibraryPath>$(XEngine_Lib64);$(LibraryPath)</LibraryPath>
8385
</PropertyGroup>
8486
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
8587
<LinkIncremental>false</LinkIncremental>
@@ -116,7 +118,7 @@
116118
<ClCompile>
117119
<WarningLevel>Level3</WarningLevel>
118120
<SDLCheck>true</SDLCheck>
119-
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
121+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
120122
<ConformanceMode>true</ConformanceMode>
121123
</ClCompile>
122124
<Link>

XEngine_APPClient/APPClient_RestApi/APPClient_RestApi.cpp

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
#ifdef _MSC_BUILD
22
#include <windows.h>
33
#include <tchar.h>
4-
#pragma comment(lib,"../../XEngine_Source/Debug/jsoncpp")
54
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
65
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIClient")
76
#pragma comment(lib,"Ws2_32")
7+
#ifdef _WIN64
8+
#pragma comment(lib,"../../XEngine_Source/x64/Debug/jsoncpp")
9+
#else
10+
#pragma comment(lib,"../../XEngine_Source/Debug/jsoncpp")
11+
#endif
812
#endif
913
#include <stdio.h>
1014
#include <string.h>
@@ -22,37 +26,37 @@ using namespace std;
2226

2327
//g++ -std=c++17 -Wall -g APPClient_RestApi.cpp -o APPClient_RestApi.exe -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp -lXEngine_BaseLib -lNetHelp_APIClient -ljsoncpp -Wl,-rpath=../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib:../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp,--disable-new-dtags
2428
//需要优先配置XEngine
25-
//WINDOWS使用VS2022 x86 debug 编译
29+
//WINDOWS使用VS2022 x86 或者 x64 debug 编译
2630
//linux使用下面的命令编译
2731
//g++ -std=c++17 -Wall -g APPClient_RestApi.cpp -o APPClient_RestApi.exe -I ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -L /usr/local/lib/XEngine_Release/XEngine_BaseLib -L /usr/local/lib/XEngine_Release/XEngine_NetHelp -L ../../XEngine_Source/XEngine_ThirdPart/jsoncpp -lXEngine_BaseLib -lNetHelp_APIClient -ljsoncpp
2832

2933
//查询
3034
void API_Manage_Query()
3135
{
32-
LPCTSTR lpszUrl = _T("http://192.168.1.8:5100/Api/Manage/QueryFile");
36+
LPCXSTR lpszUrl = _X("http://192.168.1.8:5100/Api/Manage/QueryFile");
3337
int nLen = 0;
3438
int nCode = 0;
35-
TCHAR* ptszMsgBuffer = NULL;
39+
XCHAR* ptszMsgBuffer = NULL;
3640
Json::Value st_JsonRoot;
3741
st_JsonRoot["lpszTimeStart"];
3842
st_JsonRoot["lpszTimeEnd"];
3943
st_JsonRoot["lpszBuckKey"] = "storagekey2";
4044

41-
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
45+
if (!APIClient_Http_Request(_X("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
4246
{
43-
printf("API_Manage_Query:%lX\n", APIClient_GetLastError());
47+
_xtprintf("API_Manage_Query:%lX\n", APIClient_GetLastError());
4448
return;
4549
}
46-
printf("API_Manage_Query:%d,%s\n", nCode, ptszMsgBuffer);
50+
_xtprintf("API_Manage_Query:%d,%s\n", nCode, ptszMsgBuffer);
4751
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
4852
}
4953
//插入
5054
void API_Manage_Insert()
5155
{
52-
LPCTSTR lpszUrl = _T("http://192.168.1.8:5100/Api/Manage/Insert");
56+
LPCXSTR lpszUrl = _X("http://192.168.1.8:5100/Api/Manage/Insert");
5357
int nLen = 0;
5458
int nCode = 0;
55-
TCHAR* ptszMsgBuffer = NULL;
59+
XCHAR* ptszMsgBuffer = NULL;
5660
Json::Value st_JsonRoot;
5761
Json::Value st_JsonArray;
5862
Json::Value st_JsonObject;
@@ -66,21 +70,21 @@ void API_Manage_Insert()
6670
st_JsonRoot["List"] = st_JsonArray;
6771
st_JsonRoot["Count"] = 1;
6872

69-
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
73+
if (!APIClient_Http_Request(_X("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
7074
{
71-
printf("API_Manage_Insert:%lX\n", APIClient_GetLastError());
75+
_xtprintf("API_Manage_Insert:%lX\n", APIClient_GetLastError());
7276
return;
7377
}
74-
printf("API_Manage_Insert:%d,%s\n", nCode, ptszMsgBuffer);
78+
_xtprintf("API_Manage_Insert:%d,%s\n", nCode, ptszMsgBuffer);
7579
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
7680
}
7781
//删除
7882
void API_Manage_Delete()
7983
{
80-
LPCTSTR lpszUrl = _T("http://192.168.1.8:5100/Api/Manage/Delete");
84+
LPCXSTR lpszUrl = _X("http://192.168.1.8:5100/Api/Manage/Delete");
8185
int nLen = 0;
8286
int nCode = 0;
83-
TCHAR* ptszMsgBuffer = NULL;
87+
XCHAR* ptszMsgBuffer = NULL;
8488
Json::Value st_JsonRoot;
8589
Json::Value st_JsonArray;
8690
Json::Value st_JsonObject;
@@ -91,71 +95,71 @@ void API_Manage_Delete()
9195
st_JsonRoot["List"] = st_JsonArray;
9296
st_JsonRoot["Count"] = 1;
9397

94-
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
98+
if (!APIClient_Http_Request(_X("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
9599
{
96-
printf("API_Manage_Delete:%lX\n", APIClient_GetLastError());
100+
_xtprintf("API_Manage_Delete:%lX\n", APIClient_GetLastError());
97101
return;
98102
}
99-
printf("API_Manage_Delete:%d,%s\n", nCode, ptszMsgBuffer);
103+
_xtprintf("API_Manage_Delete:%d,%s\n", nCode, ptszMsgBuffer);
100104
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
101105
}
102106
//文件夹
103107
void API_Manage_Dir()
104108
{
105-
LPCTSTR lpszUrl = _T("http://192.168.1.8:5100/Api/Manage/Dir");
109+
LPCXSTR lpszUrl = _X("http://192.168.1.8:5100/Api/Manage/Dir");
106110
int nLen = 0;
107111
int nCode = 0;
108-
TCHAR* ptszMsgBuffer = NULL;
112+
XCHAR* ptszMsgBuffer = NULL;
109113
Json::Value st_JsonRoot;
110114
//创建
111115
st_JsonRoot["lpszBuckKey"] = "storagekey1";
112116
st_JsonRoot["lpszUserDir"] = "user";
113117
st_JsonRoot["nOPerator"] = 1;
114-
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
118+
if (!APIClient_Http_Request(_X("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
115119
{
116-
printf("API_Manage_Dir:%lX\n", APIClient_GetLastError());
120+
_xtprintf("API_Manage_Dir:%lX\n", APIClient_GetLastError());
117121
return;
118122
}
119-
printf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer);
123+
_xtprintf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer);
120124
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
121125
//查询
122126
st_JsonRoot.clear();
123127
st_JsonRoot["lpszBuckKey"] = "storagekey1";
124128
st_JsonRoot["lpszUserDir"];
125129
st_JsonRoot["nOPerator"] = 0;
126-
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
130+
if (!APIClient_Http_Request(_X("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
127131
{
128-
printf("API_Manage_Dir:%lX\n", APIClient_GetLastError());
132+
_xtprintf("API_Manage_Dir:%lX\n", APIClient_GetLastError());
129133
return;
130134
}
131-
printf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer);
135+
_xtprintf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer);
132136
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
133137
//删除
134138
st_JsonRoot.clear();
135139
st_JsonRoot["lpszBuckKey"] = "storagekey1";
136140
st_JsonRoot["lpszUserDir"] = "user";
137141
st_JsonRoot["nOPerator"] = 2;
138-
if (!APIClient_Http_Request(_T("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
142+
if (!APIClient_Http_Request(_X("POST"), lpszUrl, st_JsonRoot.toStyledString().c_str(), &nCode, &ptszMsgBuffer, &nLen))
139143
{
140-
printf("API_Manage_Dir:%lX\n", APIClient_GetLastError());
144+
_xtprintf("API_Manage_Dir:%lX\n", APIClient_GetLastError());
141145
return;
142146
}
143-
printf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer);
147+
_xtprintf("API_Manage_Dir:%d,%s\n", nCode, ptszMsgBuffer);
144148
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
145149
}
146150
//任务管理
147151
void API_Manage_Task()
148152
{
149-
LPCTSTR lpszUrl = _T("http://192.168.1.8:5100/Api/Manage/Task");
153+
LPCXSTR lpszUrl = _X("http://192.168.1.8:5100/Api/Manage/Task");
150154
int nLen = 0;
151155
int nCode = 0;
152-
TCHAR* ptszMsgBuffer = NULL;
153-
if (!APIClient_Http_Request(_T("POST"), lpszUrl, NULL, &nCode, &ptszMsgBuffer, &nLen))
156+
XCHAR* ptszMsgBuffer = NULL;
157+
if (!APIClient_Http_Request(_X("POST"), lpszUrl, NULL, &nCode, &ptszMsgBuffer, &nLen))
154158
{
155-
printf("API_Manage_Task:%lX\n", APIClient_GetLastError());
159+
_xtprintf("API_Manage_Task:%lX\n", APIClient_GetLastError());
156160
return;
157161
}
158-
printf("API_Manage_Task:%d,%s\n", nCode, ptszMsgBuffer);
162+
_xtprintf("API_Manage_Task:%d,%s\n", nCode, ptszMsgBuffer);
159163
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
160164
}
161165

XEngine_APPClient/APPClient_RestApi/APPClient_RestApi.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
</PropertyGroup>
8181
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
8282
<LinkIncremental>true</LinkIncremental>
83+
<IncludePath>$(XEngine_Include);../../XEngine_Source/XEngine_ThirdPart/jsoncpp;$(IncludePath)</IncludePath>
84+
<LibraryPath>$(XEngine_Lib64);$(LibraryPath)</LibraryPath>
8385
</PropertyGroup>
8486
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
8587
<LinkIncremental>false</LinkIncremental>

0 commit comments

Comments
 (0)