duanjianjun 2 years ago
parent
commit
9108f717d1
1 changed files with 29 additions and 0 deletions
  1. 29 0
      MFCApplication1/MFCApplication1Dlg.cpp

+ 29 - 0
MFCApplication1/MFCApplication1Dlg.cpp

@@ -11,6 +11,14 @@
 #include "BaseUtility.h"
 #include "libpdf.h"
 
+#if defined(GNUC)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored “-Wdeprecated-declarations”
+#elif defined(_MSC_VER)
+#pragma warning(disable : 4996)
+#endif
+
+#include <json/json.h>
 #ifdef _DEBUG
 #pragma comment(lib, "libpdfd.lib")
 #else
@@ -81,6 +89,27 @@ DWORD WINAPI ProcessThread(void *param)
 	CMFCApplication1Dlg* pWnd = (CMFCApplication1Dlg*)theApp.m_pMainWnd;
 	//1.读txt列表
 	//2.生成图像及图像对应的模板json
+	Json::Value jsonArray(Json::arrayValue);
+	Json::Value item;
+	item["status"] = "1";
+	item["url"] = "1";
+	jsonArray.append(item);
+
+	Json::Value itemRoot;
+	itemRoot["status"] = 1;
+	itemRoot["url"] = "1";
+	
+	Json::FastWriter writer;
+	std::string strJson = writer.write(itemRoot);
+
+	Json::Features features;
+	Json::Reader re(features);
+	Json::Value root;
+	re.parse(strJson, root);
+	if (root["status"].isInt() && root["status"].asInt() == 1)
+	{
+		string strUrl = root["url"].asString();
+	}
 	//3.图像合并成pdf
 
 	//通知发送消息到窗口