Download Source Code

CModule Class Reference

Encapsulates the Windows LoadLibrary() API functions. More...

#include <Module.h>

Inheritance diagram for CModule:

Inheritance graph
[legend]
Collaboration diagram for CModule:

Collaboration graph
[legend]
List of all members.

Public Member Functions

LPVOID Addr (DWORD i)
 Returns the function address for specified index.
LPVOID Addr (LPCTSTR pFunctionName)
 Returns a pointer to the specified function name.
void * AddFunction (LPCTSTR pFunctionName)
 Adds the specified function to the function list.
BOOL LoadLibrary (LPCTSTR pFile)
 Loads the specified module.
LPCTSTR GetLibraryPath ()
 Returns the file path of the currently loaded module.
 CModule ()
 Default constructor.
 CModule (LPCTSTR pFile)
 Constructs object and loads the specified module.
virtual ~CModule ()
 Destructor.
virtual void Destroy ()
 Unloads the module and releases associated resources.
virtual DWORD GetObjSize ()
 Returns the size, in bytes, of a module function structure.
void * operator[] (unsigned long i)
 Returns the function address for specified index.
HMODULE GetModuleHandle ()
 Returns the loaded modules handle.
BOOL IsLoaded ()
 Returns non-zero if there is a valid module handle.

Detailed Description

Encapsulates the Windows LoadLibrary() API functions.

Encapsulates the Windows LoadLibrary() API functions. Provides a simple way to load Windows DLLs and execute functions.


Constructor & Destructor Documentation

CModule::CModule LPCTSTR  pFile  ) 
 

Constructs object and loads the specified module.

Parameters:
[in] pFile - Module filename


Member Function Documentation

void * CModule::AddFunction LPCTSTR  pFunctionName  ) 
 

Adds the specified function to the function list.

Parameters:
[in] pFunctionName - Function name
Returns:
Pointer to function address or NULL if not found
See also:

LPVOID CModule::Addr LPCTSTR  pFunctionName  ) 
 

Returns a pointer to the specified function name.

Parameters:
[in] pFunctionName - Function name
Returns:
Pointer to function or NULL if not found
See also:

LPVOID CModule::Addr DWORD  i  ) 
 

Returns the function address for specified index.

Parameters:
[in] i - Function index
Returns:
Pointer to function or NULL if none
See also:

BOOL CModule::LoadLibrary LPCTSTR  pFile  ) 
 

Loads the specified module.

Parameters:
[in] pFile - Module filename
Returns:
Non-zero if success
See also:

void* CModule::operator[] unsigned long  i  )  [inline]
 

Returns the function address for specified index.

Parameters:
[in] i - Function index
Returns:
Pointer to function or NULL if none
See also:


The documentation for this class was generated from the following files:
  • inc/Module.h
  • Module.cpp
Copyright Robert Umbehant
This documentation is covered by the LGPL