CBS_GSupport Class Reference

The main class of GSupport library. More...

Collaboration diagram for CBS_GSupport:

Collaboration graph
[legend]
List of all members.

Static Public Member Functions

void FreeGSupportLib (LPCTSTR lpFileName, UINT nLine)
LPCTSTR GetAppName (LPTSTR *lpFilePart)
HINSTANCE GetInstance ()
CBS_ResTrackGetResTrack ()
DWORD GetResTrackMBTime ()
CBS_TraceGetTrace ()
BOOL IsLibLoaded ()
void LoadGSupportLib (LPCTSTR lpFileName, UINT nLine)
BOOL SetResTrack (CBS_ResTrack *pNewTrack)
DWORD SetResTrackDefaultMBTime ()
DWORD SetResTrackInfiniteMBTime ()
DWORD SetResTrackMBTime (DWORD dwNewTime)

Detailed Description

The main class of GSupport library.

Author:
Dror Otmi
Date:
12.07.2003
Version:
V 1.0 Initial version
The main class for the DLL manipulation.
All of the methods are static and the constructor is private so that neither an object of this class nor of a derived class could be instantiated.
The reason the methods are encapsulate in the class is mainly to avoid a name conflict with existing methods.


Member Function Documentation

void CBS_GSupport::FreeGSupportLib LPCTSTR  lpFileName,
UINT  nLine
[static]
 

Free the library. The application should not use any component of the library after this call is made. For each 'load' call a referece count is increased, the library is actually freed when the referece count is zero. If the application is terminated before the library is successfully freed, the Resource Trace will report an error.

Parameters:
lpFileName The file in which the call was done.
nLine The line in pFileName.
Returns:
Nothing

LPCTSTR CBS_GSupport::GetAppName LPTSTR *  lpFilePart  )  [static]
 

See return.

Parameters:
lpFilePart A pointer to the file part of the application. This parameter can be NULL.
Returns:
The full path of the running application.

HINSTANCE CBS_GSupport::GetInstance  )  [static]
 

See return.

Returns:
The handle of the instance of the DLL.

CBS_ResTrack * CBS_GSupport::GetResTrack  )  [static]
 

See return.

Returns:
the pointer of the local resource track so that other libraries or application could use the same object in their code.

DWORD CBS_GSupport::GetResTrackMBTime  )  [static]
 

See return.

Returns:
The Resource Track's message box timeout.

static CBS_Trace * CBS_GSupport::GetTrace  )  [static]
 

See return.

Returns:
Return the pointer to the singleton trace object. The application an all other library that use GSupport, should access their trace object using this function in order to use the same trace output in the whole application. The trace object is ready to use after LoadGSupportLib() return and is valid until FreeGSupportLib is called.

BOOL CBS_GSupport::IsLibLoaded  )  [static]
 

See return.

Returns:
TRUE if the library is loaded.

void CBS_GSupport::LoadGSupportLib LPCTSTR  lpFileName,
UINT  nLine
[static]
 

Loads GSupport library. This function must be invoked before the application could use GSupport. The function could be called more then once, but for each call there must be a call to FreeGSupportLib. Each call is registered in the Resource Track. If there are more 'load' calls then 'free', the library will not be freed and the Resource Trace will report an error when the application exits.

Note:
LoadGSupportLib is defined as: LoadGSupportLib( __FILE__, __LINE__ )
therefore the application should not bother about the file name and line number. An Application can call CBS_GSupport::IsLibLoaded( ) to check if the library is already loaded.
Parameters:
lpFileName The file in which the call was done.
nLine The line in pFileName.
Returns:
Nothing

BOOL CBS_GSupport::SetResTrack CBS_ResTrack pNewTrack  )  [static]
 

Sets a new resources track object to GSupport. If the application wants to use another resources track object, it can set it to GSupport because it make sense to use one resources track object in the application. The currently used object will be merged with the new object and then emptied. All resources registration will be done to the new object.

Note:
If the application uses its own resources track object, it is also responsible to call CBS_ResTrack::CheckNFree() when it exits, GSupport will not do it in this case.
Parameters:
pNewTrack The track that should be used in the DLL.
Returns:
If pNewTrack could be set to the object TRUE.
If pNewTrack is NULL, the function will assert.
If pNewTrack equals the currently used pResTrack the function will do nothing and return FALSE.

DWORD CBS_GSupport::SetResTrackDefaultMBTime  )  [static]
 

Sets the Resource Track's message box default timeout (5 second).

Returns:
The currently default message box timeout in the Resource Track.

DWORD CBS_GSupport::SetResTrackInfiniteMBTime  )  [static]
 

Sets the Resource Track's message box timeout to infinite ( -1 ).

Returns:
The currently used message box timeout in the Resource Track.

DWORD CBS_GSupport::SetResTrackMBTime DWORD  dwNewTime  )  [static]
 

Sets a timeout to the Resource Track's message box that is displayed if a Resource leak was detected.

Parameters:
dwNewTime The new timeout.
Returns:
The old timeout associated with the Resource Track object.
Bitspot AG


Bitspot AG
Rietlistrasse 1
CH-6345 Neuheim

Bitspot AG Logo

Phone:

+41 41 755 11 22

Fax:

+41 41 755 11 31

e-mail:

mail@bitspot.com

Web:

www.bitspot.com