Public Member Functions | Protected Attributes

DynamicLoadLibFct< FCT > Struct Template Reference

link dynamicly to functions by using LoadLibrary() and GetProcAddress() More...

#include <utility.h>

Collaboration diagram for DynamicLoadLibFct< FCT >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DynamicLoadLibFct (LPCTSTR moduleName, UINT ordinal)
 DynamicLoadLibFct (LPCTSTR moduleName, LPCSTR name)
 ~DynamicLoadLibFct ()
FCT operator* () const
 operator bool () const

Protected Attributes

HMODULE _hModule
FCT _fct

Detailed Description

template<typename FCT>
struct DynamicLoadLibFct< FCT >

link dynamicly to functions by using LoadLibrary() and GetProcAddress()

Definition at line 990 of file utility.h.


Constructor & Destructor Documentation

template<typename FCT>
DynamicLoadLibFct< FCT >::DynamicLoadLibFct ( LPCTSTR  moduleName,
UINT  ordinal 
) [inline]

Definition at line 992 of file utility.h.

    {
        _hModule = LoadLibrary(moduleName);

        _fct = (FCT) GetProcAddress(_hModule, (LPCSTR)ordinal);
    }
template<typename FCT>
DynamicLoadLibFct< FCT >::DynamicLoadLibFct ( LPCTSTR  moduleName,
LPCSTR  name 
) [inline]

Definition at line 999 of file utility.h.

    {
        _hModule = LoadLibrary(moduleName);

        _fct = (FCT) GetProcAddress(_hModule, name);
    }
template<typename FCT>
DynamicLoadLibFct< FCT >::~DynamicLoadLibFct (  ) [inline]

Definition at line 1006 of file utility.h.

    {
        FreeLibrary(_hModule);
    }

Member Function Documentation

template<typename FCT>
DynamicLoadLibFct< FCT >::operator bool (  ) const [inline]

Definition at line 1012 of file utility.h.

{return _fct? true: false;}
template<typename FCT>
FCT DynamicLoadLibFct< FCT >::operator* (  ) const [inline]

Definition at line 1011 of file utility.h.

{return _fct;}

Member Data Documentation

template<typename FCT>
FCT DynamicLoadLibFct< FCT >::_fct [protected]

Definition at line 1016 of file utility.h.

template<typename FCT>
HMODULE DynamicLoadLibFct< FCT >::_hModule [protected]

Definition at line 1015 of file utility.h.


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

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage