OWLNext 6.32
Public Member Functions | Protected Attributes
owl::TResource< T, resType > Class Template Reference

#include <wsyscls.h>

List of all members.

Public Member Functions

 TResource (HINSTANCE hModule, TResId resId)
 TResource (HINSTANCE hModule, TResId resid, LANGID langid)
 ~TResource ()
bool IsOK () const
 operator T * ()

Protected Attributes

HGLOBAL MemHandle
T * MemPtr

Detailed Description

template<class T, int resType>
class owl::TResource< T, resType >

TResource simplifies access to a resource by encapsulating the find, load, lock and free steps for accessing a resource.


Constructor & Destructor Documentation

template<class T , int resType>
owl::TResource< T, resType >::TResource ( HINSTANCE  hModule,
TResId  resId 
)

Loads & locks the specified resource..

References owl::TResource< T, resType >::MemHandle, and owl::TResource< T, resType >::MemPtr.

template<class T , int resType>
owl::TResource< T, resType >::TResource ( HINSTANCE  hModule,
TResId  resId,
LANGID  lcid 
)

Loads & locks a resource of the type 'resType' from the module (hModule). Accepts a LanguageID for localized resources.

References owl::TResource< T, resType >::MemHandle, and owl::TResource< T, resType >::MemPtr.

template<class T , int resType>
owl::TResource< T, resType >::~TResource ( )

Unlocks and frees the resource loaded earlier.

Note:
Unlocking and freeing of resources is not necessary in WIN32.

Member Function Documentation

template<class T , int resType>
bool owl::TResource< T, resType >::IsOK ( ) const

Confirms whether resource was found.

Returns true if resource was successfully loaded or false otherwise.

template<class T , int resType>
owl::TResource< T, resType >::operator T * ( )

Conversion operator to point to structure representing binary layout of the resource...

Returns a pointer to the locked resource.

Note:
This operator eliminates the need to explicitly cast LPVOID to a structure representing the actual layout of individual resource types.

Member Data Documentation

template<class T, int resType>
HGLOBAL owl::TResource< T, resType >::MemHandle [protected]

Handle of resource.

template<class T, int resType>
T* owl::TResource< T, resType >::MemPtr [protected]

Pointer to locked resource.


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