SoftechSoftware homepage
SoftechSoftware Email
Abstract
IconsST is a resource-only DLL containing a number of usefull, ready-to-use icons of various sizes and colors.
This DLL can be loaded and accessed using the commong Win32 API functions or via the CResourceServerST
class.
CResourceServerST
lets to load a generic resource-only DLL and to access nearly all the resource types that
can be contained.
Current version of CResourceServerST
is 1.1
The demo application shows only a little number of the icons contained into the DLL. For the complete list of the icons
please refer to this image.
How to integrate CResourceServerST in your application
In your project include the following files:
- ResourceServerST.h
- ResourceServerST.cpp
Where needed, create an instance of CResourceServerST:
CResourceServerST m_Icons;
Now lets the instance to load a DLL. This can be done in the application init-section or, for dialog-based
applications, in your OnInitDialog:
DWORD dwRetValue;
dwRetValue = m_Icons.Load(_T("c:\\IconsST.dll"));
ASSERT(dwRetValue == RESSRVST_OK);
The DLL will be automatically unloaded when the instance goes out of scope.
To manually unload the DLL (for example to load another one) the UnLoad() method can
be used:
DWORD dwRetValue;
dwRetValue = m_Icons.UnLoad();
ASSERT(dwRetValue == RESSRVST_OK);
Class methods
CResourceServerST
Constructs a CResourceServerST object. Optionally a DLL can be loaded.
CResourceServerST(LPCTSTR lpszDllName = NULL, DWORD dwFlags = 0)
Load
Initializes the CResourceServerST class loading the specified DLL.
DWORD Load(LPCTSTR lpszDllName, DWORD dwFlags = 0)
UnLoad
Unloads the previously loaded DLL.
DWORD UnLoad()
LoadImage
Loads an icon, cursor or bitmap.
HANDLE LoadImage(LPCTSTR lpszName, UINT uType, int cxDesired, int cyDesired, UINT fuLoad)
LoadImage
Loads an icon, cursor or bitmap.
HANDLE LoadImage(UINT uID, UINT uType, int cxDesired, int cyDesired, UINT fuLoad)
LoadIcon
Loads an icon.
HICON LoadIcon(LPCTSTR lpszName)
LoadIcon
Loads an icon.
HICON LoadIcon(UINT uID)
LoadString
Loads a string from a stringtable in the DLL.
DWORD LoadString(UINT nID, LPTSTR lpBuffer, int nBufferMax)
LoadString
Loads a string from a stringtable in the DLL.
DWORD LoadString(UINT nID, CString* spBuffer)
FindResource
Determines the location of a resource with the specified type and name.
HRSRC FindResource(LPCTSTR lpName, LPCTSTR lpType)
LoadResource
Loads into global memory the resource with the specified type and name.
HGLOBAL LoadResource(LPCTSTR lpszName, LPCTSTR lpszType)
LoadResource
Loads into global memory the resource with the specified type and name.
HGLOBAL LoadResource(HRSRC hResInfo)
LoadDialog
Loads into global memory the specified dialog template.
HGLOBAL LoadDialog(UINT nID)
GetLastError
Returns the last error generated by the class.
DWORD GetLastError()
History (CResourceServerST)
- v1.1 (26/November/2001)
First public release
- v1.0 (26/August/1999)
Private release
Want to include CResourceServerST in a DLL ?
CResourceServerST
is ready to be used from inside a DLL. You need to export from your DLL
CResourceServerST
.
Include in your DLL's project the following files:
- ResourceServerST.h
- ResourceServerST.cpp
Add to your DLL's project settings the following defines:
- _CMLHTDLL_NOLIB_
- _CMLHTDLL_BUILDDLL_
From
ResourceServerST.h
comment the following line:
#define _RESOURCESERVERST_NODLL_
then update the various
#pragma comment(lib, "???")
according to your DLL produced .lib files.
Disclaimer
THE SOFTWARE AND THE ACCOMPANYING FILES ARE DISTRIBUTED "AS IS" AND WITHOUT ANY WARRANTIES WHETHER EXPRESSED OR IMPLIED.
NO REPONSIBILITIES FOR POSSIBLE DAMAGES OR EVEN FUNCTIONALITY CAN BE TAKEN.
THE USER MUST ASSUME THE ENTIRE RISK OF USING THIS SOFTWARE.