12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- // test.cpp : 定义控制台应用程序的入口点。
- //
- #include "stdafx.h"
- #include "test.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #endif
- // 唯一的应用程序对象
- CWinApp theApp;
- using namespace std;
- int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
- {
- int nRetCode = 0;
- // 初始化 MFC 并在失败时显示错误
- if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
- {
- // TODO: 更改错误代码以符合您的需要
- _tprintf(_T("错误: MFC 初始化失败\n"));
- nRetCode = 1;
- }
- else
- {
- // 1、查询订单是否已下载成功;
- int nRet = QueryMidInfo("IDL144240G");
- printf("QueryMidInfo:%d\n", nRet);
- if ( nRet != 2 )
- {
- // 未下载成功,开始后台下载;
- nRet = DownloadMidData("IDL144240G");
- printf("DownloadMidData:%d\n", nRet);
- }
- // 2、等待下载成功;
- while ( nRet != 2 )
- {
- nRet = QueryMidInfo("IDL144240G");
- printf("QueryMidInfo:%d\n", nRet);
- Sleep(1000);
- }
- // 单个sn抄写结果上报;
- nRet = ReportKeyCopyResults("TEST-3311-8811");
- printf("ReportKeyCopyResults:%d\n", nRet);
- // 1000个sn抄写结果上报;
- nRet = BatchReportKeyCopyResults();
- printf("BatchReportKeyCopyResults:%d\n", nRet);
- }
- system("pause");
- return nRetCode;
- }
|