diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-18 14:16:30 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-18 14:16:30 +0300 |
commit | 73d12d0f6eb5c673a951eec94ddf5cdeeacde369 (patch) | |
tree | efd476c9f8ba590f07a1fbfed85fa13e994a596f /include | |
parent | 0f6d791bb25af9b70637601ebe50029cb69b2e75 (diff) |
constructor of CMPlugin now registers it automatically in the module list, no need to call RegisterModule manually
Diffstat (limited to 'include')
-rw-r--r-- | include/delphi/m_core.inc | 12 | ||||
-rw-r--r-- | include/m_core.h | 6 | ||||
-rw-r--r-- | include/newpluginapi.h | 2 |
3 files changed, 5 insertions, 15 deletions
diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc index f5af2c3ca4..7e913e2d7a 100644 --- a/include/delphi/m_core.inc +++ b/include/delphi/m_core.inc @@ -382,18 +382,6 @@ function mir_wstrcmpi(const p1,p2:PWideChar):int; stdcall; external CoreDLL name 'mir_wstrcmpi';
///////////////////////////////////////////////////////////////////////////////
-// modules
-
-procedure RegisterModule(hInst:HINST); stdcall;
- external CoreDLL name 'RegisterModule';
-procedure UnregisterModule(hInst:HINST); stdcall;
- external CoreDLL name 'UnregisterModule';
-
-function GetInstByAddress(codePtr:pointer):HINST; stdcall;
- external CoreDLL name 'GetInstByAddress';
-
-
-///////////////////////////////////////////////////////////////////////////////
// print functions
function mir_snprintf(buffer:PAnsiChar;count:size_t;fmt:PAnsiChar{, ...}):int; stdcall;
diff --git a/include/m_core.h b/include/m_core.h index e5d7cbfb59..2b85a8e36c 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -309,10 +309,12 @@ MIR_CORE_DLL(wchar_t*) mir_wstrndup(const wchar_t *str, size_t len); ///////////////////////////////////////////////////////////////////////////////
// modules
-MIR_CORE_DLL(void) RegisterModule(HINSTANCE hInst);
-MIR_CORE_DLL(void) UnregisterModule(HINSTANCE hInst);
+class CMPluginBase;
+MIR_CORE_DLL(void) RegisterModule(CMPluginBase*);
+MIR_CORE_DLL(void) UnregisterModule(CMPluginBase*);
MIR_CORE_DLL(HINSTANCE) GetInstByAddress(void* codePtr);
+MIR_CORE_DLL(CMPluginBase&) GetPluginByInstance(HINSTANCE hInst);
///////////////////////////////////////////////////////////////////////////////
// print functions
diff --git a/include/newpluginapi.h b/include/newpluginapi.h index 278b9192e4..c7c8f37a42 100644 --- a/include/newpluginapi.h +++ b/include/newpluginapi.h @@ -157,9 +157,9 @@ class MIR_APP_EXPORT CMPluginBase void tryOpenLog();
protected:
+ HINSTANCE m_hInst;
const char *m_szModuleName;
HANDLE m_hLogger = nullptr;
- HINSTANCE m_hInst;
CMPluginBase(const char *moduleName);
~CMPluginBase();
|