예제 #1
0
BOOL CUploadsWnd::LoadFumCoreDll(bool bShowUI)
{
	if (m_hUploadsDll == NULL)
	{
		#ifndef _DEBUG
			CString strFP = fsGetFumProgramFilesFolder ();
			m_hUploadsDll = LoadLibrary (strFP + "fumcore.dll");
		#else
			CString strFP = vmsGetAppFolder ();
			m_hUploadsDll = LoadLibrary (strFP + "Fum\\fumcore.dll");

		#endif
	
			if (m_hUploadsDll == NULL)
				return FALSE;
	}

    vmsUploadsDll::FNGV pfnGetVersion = (vmsUploadsDll::FNGV) GetProcAddress (m_hUploadsDll,
     	"_GetVersion");
	DWORD dwMajorVer;
    pfnGetVersion (&dwMajorVer, NULL);
	if (dwMajorVer != vmsUploadsDll::DLL_INTERFACE_VERSION)
	{
		FreeLibrary (m_hUploadsDll);
		m_hUploadsDll = NULL;

		if (bShowUI)
		{
			::MessageBox (AfxGetApp ()->m_pMainWnd->m_hWnd,
				LS (L_FDM_FUMCOREDLL_REQTOUPDATE), LS (L_WARNING), MB_ICONERROR);
		}

		return FALSE;
	}

	return TRUE;
}
void vmsUploadsDllCaller::GetCommonFilesFolder(LPSTR psz)
{
	lstrcpy (psz, fsGetFumProgramFilesFolder ());
}