mfc_loader.h

Go to the documentation of this file.
00001 #ifndef MFC_LIBRARY_LOADER_CLASS
00002 #define MFC_LIBRARY_LOADER_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : mfc_library_loader                                                *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *  Purpose:                                                                   *
00010 *                                                                             *
00011 *    Supports using MFC dynamic libraries.  The base class only supports      *
00012 *  non-MFC DLLs through the Win32 API library functions.  There is potential  *
00013 *  for corruption of MFC globals when loading an MFC DLL in a multi-threaded  *
00014 *  program, and hence there must be a special loader that uses AfxLoadLibrary *
00015 *  and AfxFreeLibrary instead of the API versions.                            *
00016 *                                                                             *
00017 *******************************************************************************
00018 * Copyright (c) 2000-$now By Author.  This program is free software; you can  *
00019 * redistribute it and/or modify it under the terms of the GNU General Public  *
00020 * License as published by the Free Software Foundation; either version 2 of   *
00021 * the License or (at your option) any later version.  This is online at:      *
00022 *     http://www.fsf.org/copyleft/gpl.html                                    *
00023 * Please send any updates to: fred@gruntose.com                               *
00024 \*****************************************************************************/
00025 
00026 #include "mfc_dll.h"
00027 
00028 #include <opsystem/dynamic_loader.h>
00029 
00030 namespace library_plugins {
00031 
00032   class MFC_EXTENSIONS_CLASS_STYLE mfc_library_loader
00033   : public dynamic_library_loader
00034   { 
00035   public:
00036     mfc_library_loader(const istring &dll_name);
00037       // loads the DLL with the "dll_name".  the loaded() function returns true
00038       // if the DLL was found and attached to.
00039 
00040     virtual ~mfc_library_loader();
00041 
00042   protected:
00043     virtual void *load_library(const char *to_load);
00044     virtual void free_library(void *to_free);
00045       // loads MFC DLLs appropriately for their thread issues.
00046   };
00047 
00048 } // namespace.
00049 
00050 #endif
00051 

Generated on Fri Nov 28 04:28:59 2008 for HOOPLE Libraries by  doxygen 1.5.1