1
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
2
* Copyright (C) 2007 Constantin Kaplinsky. All Rights Reserved.
4
* This is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This software is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this software; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
20
#include "DynamicFn.h"
22
DynamicFnBase::DynamicFnBase(const TCHAR* dllName, const char* fnName) : fnPtr(0), dllHandle(0) {
23
dllHandle = LoadLibrary(dllName);
25
vnclog.Print(LL_INTERR, VNCLOG("DLL %s not found (error %d)"),
26
(const char*)dllName, GetLastError());
29
fnPtr = (void *) GetProcAddress(dllHandle, fnName);
31
vnclog.Print(LL_INTERR, VNCLOG("proc %s not found in %s (error %d)"),
32
fnName, (const char*)dllName, GetLastError());
35
DynamicFnBase::~DynamicFnBase() {
37
FreeLibrary(dllHandle);