foobar2000 SDK  2015-08-03
Public Member Functions | Static Public Member Functions | Data Fields
CDLL

#include <win32_misc.h>

Public Member Functions

 CDLL (const wchar_t *Name)
 
 CDLL ()
 
 ~CDLL ()
 
template<typename funcptr_t >
void Bind (funcptr_t &outFunc, const char *name)
 
void Load (const wchar_t *Name)
 
 PFC_CLASS_NOT_COPYABLE_EX (CDLL)
 

Static Public Member Functions

static LPTOP_LEVEL_EXCEPTION_FILTER _GetEH ()
 

Data Fields

HMODULE hMod
 

Detailed Description

Definition at line 293 of file win32_misc.h.

Constructor & Destructor Documentation

CDLL::CDLL ( const wchar_t *  Name)
inline

Definition at line 302 of file win32_misc.h.

302  : hMod() {
303  Load(Name);
304  }
HMODULE hMod
Definition: win32_misc.h:325
void Load(const wchar_t *Name)
Definition: win32_misc.h:306
CDLL::CDLL ( )
inline

Definition at line 305 of file win32_misc.h.

305 : hMod() {}
HMODULE hMod
Definition: win32_misc.h:325
CDLL::~CDLL ( )
inline

Definition at line 318 of file win32_misc.h.

318  {
319  if (hMod) FreeLibrary(hMod);
320  }
HMODULE hMod
Definition: win32_misc.h:325

Member Function Documentation

static LPTOP_LEVEL_EXCEPTION_FILTER CDLL::_GetEH ( )
inlinestatic

Definition at line 296 of file win32_misc.h.

296  {
297  LPTOP_LEVEL_EXCEPTION_FILTER rv = SetUnhandledExceptionFilter(NULL);
298  SetUnhandledExceptionFilter(rv);
299  return rv;
300  }
template<typename funcptr_t >
void CDLL::Bind ( funcptr_t &  outFunc,
const char *  name 
)
inline

Definition at line 321 of file win32_misc.h.

321  {
322  WIN32_OP( outFunc = (funcptr_t)GetProcAddress(hMod, name) );
323  }
HMODULE hMod
Definition: win32_misc.h:325
void CDLL::Load ( const wchar_t *  Name)
inline

Definition at line 306 of file win32_misc.h.

306  {
307  PFC_ASSERT( hMod == NULL );
308 #ifdef _DEBUG
309  auto handlerBefore = _GetEH();
310 #endif
311  WIN32_OP( hMod = LoadLibrary(Name) );
312 #ifdef _DEBUG
313  PFC_ASSERT( handlerBefore == _GetEH() );
314 #endif
315  }
static LPTOP_LEVEL_EXCEPTION_FILTER _GetEH()
Definition: win32_misc.h:296
HMODULE hMod
Definition: win32_misc.h:325
CDLL::PFC_CLASS_NOT_COPYABLE_EX ( CDLL  )

Field Documentation

HMODULE CDLL::hMod

Definition at line 325 of file win32_misc.h.


The documentation for this class was generated from the following file: