Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/external/source/vncdll/winvnc/DynamicFn.h
Views: 11779
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.1* Copyright (C) 2007 Constantin Kaplinsky. All Rights Reserved.2*3* This is free software; you can redistribute it and/or modify4* it under the terms of the GNU General Public License as published by5* the Free Software Foundation; either version 2 of the License, or6* (at your option) any later version.7*8* This software is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11* GNU General Public License for more details.12*13* You should have received a copy of the GNU General Public License14* along with this software; if not, write to the Free Software15* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,16* USA.17*/1819// Helper class managing dynamic linkage to DLL functions.2021#ifndef __RFB_WIN32_DYNAMICFN_H__22#define __RFB_WIN32_DYNAMICFN_H__2324#include "stdhdrs.h"2526class DynamicFnBase {27public:28DynamicFnBase(const TCHAR* dllName, const char* fnName);29~DynamicFnBase();30bool isValid() const {return fnPtr != 0;}31protected:32void* fnPtr;33HMODULE dllHandle;34private:35DynamicFnBase(const DynamicFnBase&);36DynamicFnBase operator=(const DynamicFnBase&);37};3839template<class T> class DynamicFn : public DynamicFnBase {40public:41DynamicFn(const TCHAR* dllName, const char* fnName) : DynamicFnBase(dllName, fnName) {}42T operator *() const {return (T)fnPtr;};43};4445#endif464748