123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #include "StdAfx.h"
- #include "lyfzLoadLibrary.h"
- namespace lyfzLibrary
- {
- HMODULE g_hCloudSelectionLib = NULL;
- API_uploadorder g_uploadorder = NULL;
- API_uploadgoodinfo g_uploadgoodinfo = NULL;
- API_uploadimg g_uploadimg = NULL;
- API_getcloundresult g_getcloundresult = NULL;
- BOOL LoadCloudSelectionLib()
- {
- if ( g_hCloudSelectionLib == NULL )
- g_hCloudSelectionLib = LoadLibrary(_T("lyfzCloudSelection.dll"));
- if ( !g_hCloudSelectionLib )
- {
- AfxMessageBox(_T("打开云链接库失败"));
- return FALSE;
- }
- g_uploadorder = (API_uploadorder)GetProcAddress(g_hCloudSelectionLib, "uploadorder");
- if ( g_uploadorder == NULL )
- {
- AfxMessageBox(_T("获取生成云接口失败"));
- return FALSE;
- }
- g_uploadgoodinfo = (API_uploadgoodinfo)GetProcAddress(g_hCloudSelectionLib, "uploadgoodinfo");
- if ( g_uploadgoodinfo == NULL )
- {
- AfxMessageBox(_T("获取生成云接口失败"));
- return FALSE;
- }
- g_uploadimg = (API_uploadimg)GetProcAddress(g_hCloudSelectionLib, "uploadImg");
- if ( g_uploadimg == NULL )
- {
- AfxMessageBox(_T("获取生成云接口失败"));
- return FALSE;
- }
-
- g_getcloundresult = (API_getcloundresult)GetProcAddress(g_hCloudSelectionLib, "getresult");
- if ( g_getcloundresult == NULL )
- {
- return FALSE;
- }
- return TRUE;
- }
- void FreeCloudSelectionLib()
- {
- if ( g_hCloudSelectionLib )
- FreeLibrary(g_hCloudSelectionLib);
- }
- };
|