*/
HMODULE DLLPSTUB::Load()
{
+ // DLLPSTUB assumes that it is embedded in its owner
+ // followed by a char array of the DLL name to load
+ // so it access the char array via *(this + 1)
LPCSTR *proxy = (LPCSTR *) (this + 1);
HMODULE handle = NULL;
if (LPCSTR name = *proxy)
handle = LoadLibraryA(name);
if (handle)
{
+ // If any of the version members are non-zero
+ // then we require that DLL export "DllGetVersion"
+ // and report a version as least as high as our
+ // version number members
if (dwMajorVersion || dwMinorVersion || dwBuildNumber)
{
// Is the DLL up to date?
/**
* @brief stub class to help implement DLL proxies
+ *
+ * A DLLPSTUB must be embedded in an object followed immediately by a
+ * char array name of the DLL to load
+ * Eg
+ * ...
+ * DLLPSTUB stub;
+ * char dllname[50];
+ *
+ * If dll is not found, DLLPSTUB::Load will throw an exception
+ * If any of dwMajorVersion, dwMinorVersion, dwBuildNumber are non-zero
+ * the DLLPSTUB::Load will throw an exception (CO_S_NOTALLINTERFACES) unless
+ * the dll exports DllGetVersion and reports a version at least as high as
+ * requested by these members
*/
struct DLLPSTUB
{
extern struct ICONV::Proxy
{
// ICONV dll proxy
- DLLPSTUB stub;
+ DLLPSTUB stub; // DLLPSTUB must be followed by char array naming the DLL
LPCSTR ICONV[&((ICONV*)0)->END - &((ICONV*)0)->BEGIN];
HMODULE handle;
struct ICONV *operator->()
+2005-09-04 Perry
+ Cosmetic: Perry adding comments about usage of dllpstub
+ Src: dllpstub.cpp dllpstub.h markdown.h
+
2005-09-04 Kimmo
PATCH: [ 1281059 ] Avoid uninitialised members in CLanguageSelect
Submitted by Csaba Raduly