00001 /* 00002 Free Download Manager Copyright (c) 2003-2007 FreeDownloadManager.ORG 00003 Open Download Manager Copyright (c) 2008-2010 OpenDownloadManager.ORG 00004 */ 00005 00006 #include "stdafx.h" 00007 #include "vmsComDLL.h" 00008 00009 #ifdef _DEBUG 00010 #undef THIS_FILE 00011 static char THIS_FILE[]=__FILE__; 00012 #define new DEBUG_NEW 00013 #endif 00014 00015 vmsComDLL::vmsComDLL() 00016 { 00017 CoInitialize (NULL); 00018 m_pfnRegServer = m_pfnUnregServer = NULL; 00019 } 00020 00021 vmsComDLL::~vmsComDLL() 00022 { 00023 CoUninitialize (); 00024 } 00025 00026 bool vmsComDLL::Load(LPCSTR pszDll) 00027 { 00028 if (false == vmsDLL::Load (pszDll)) 00029 return false; 00030 00031 m_pfnRegServer = (FNDLLRS) GetProcAddress ("DllRegisterServer"); 00032 m_pfnUnregServer = (FNDLLRS) GetProcAddress ("DllUnregisterServer"); 00033 00034 return m_pfnRegServer != NULL && m_pfnUnregServer != NULL; 00035 } 00036 00037 HRESULT vmsComDLL::RegisterServer(bool bRegister) 00038 { 00039 FNDLLRS pfn = bRegister ? m_pfnRegServer : m_pfnUnregServer; 00040 if (pfn == NULL) 00041 return E_NOTIMPL; 00042 return pfn (); 00043 }
1.5.6