123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- // stdafx.cpp : 只包括标准包含文件的源文件
- // TestCase.pch 将作为预编译头
- // stdafx.obj 将包含预编译类型信息
- #include "stdafx.h"
- // 声明函数指针;
- LOADCUSTOMERJPG g_pfLoadCustomerJPG = NULL;
- // 声明dll模块;
- HMODULE g_hMyDll = NULL;
- BOOL LoadTestCaseDll()
- {
- DWORD dwError = 0;
- if ( g_hMyDll == NULL)
- g_hMyDll = LoadLibrary(_T("Renderings.dll"));
- if ( g_hMyDll == NULL)
- {
- dwError = GetLastError();
- AfxMessageBox(_T("加载动态库失败"));
- return FALSE;
- }
- g_pfLoadCustomerJPG = (LOADCUSTOMERJPG)::GetProcAddress(g_hMyDll,"LoadRenderings");
- if ( g_pfLoadCustomerJPG == NULL)
- {
- FreeLibrary(g_hMyDll);
- g_hMyDll = NULL;
- return FALSE;
- }
- return TRUE;
- }
- void FreeTestCaseDll()
- {
- if ( g_hMyDll )
- {
- FreeLibrary(g_hMyDll);
- g_hMyDll = NULL;
- g_pfLoadCustomerJPG = NULL;
- }
- }
|