diff options
Diffstat (limited to 'protocols/Tox/src/common.h')
-rw-r--r-- | protocols/Tox/src/common.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/protocols/Tox/src/common.h b/protocols/Tox/src/common.h index ef94231761..7c5e3a71fc 100644 --- a/protocols/Tox/src/common.h +++ b/protocols/Tox/src/common.h @@ -52,4 +52,16 @@ extern HINSTANCE g_hInstance; #define TOX_DB_EVENT_TYPE_ACTION 10001
+extern HMODULE g_hToxLibrary;
+
+template<typename T>
+T CreateFunction(LPCSTR functionName)
+{
+ if (g_hToxLibrary == NULL)
+ {
+ g_hToxLibrary = LoadLibrary(L"libtox.dll");
+ }
+ return reinterpret_cast<T>(GetProcAddress(g_hToxLibrary, functionName));
+}
+
#endif //_COMMON_H_
\ No newline at end of file |