diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-12-24 21:35:41 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-12-24 21:35:41 +0000 |
commit | 603ac95a7dd5231d56b2c4e930b88dc8fb9e40a1 (patch) | |
tree | 5c6f6c48f01e48b5b2d37d574250a8d25f8d44ac /protocols/Tox/src/common.h | |
parent | 2aeafe32df3ae171b6feaa543f181f1f42805ea4 (diff) |
Tox: calling of api function from libtox.dll
git-svn-id: http://svn.miranda-ng.org/main/trunk@11606 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
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 |