From 603ac95a7dd5231d56b2c4e930b88dc8fb9e40a1 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Wed, 24 Dec 2014 21:35:41 +0000 Subject: Tox: calling of api function from libtox.dll git-svn-id: http://svn.miranda-ng.org/main/trunk@11606 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/common.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'protocols/Tox/src/common.h') 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 +T CreateFunction(LPCSTR functionName) +{ + if (g_hToxLibrary == NULL) + { + g_hToxLibrary = LoadLibrary(L"libtox.dll"); + } + return reinterpret_cast(GetProcAddress(g_hToxLibrary, functionName)); +} + #endif //_COMMON_H_ \ No newline at end of file -- cgit v1.2.3