home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 035 / kwclass.zip / KLIBRARY.HPP < prev    next >
C/C++ Source or Header  |  1994-04-18  |  1KB  |  49 lines

  1. #ifndef _KLIBRARY_
  2.   #define _KLIBRARY_
  3.  
  4. #ifndef _IBASE_
  5.   #include <ibase.hpp>
  6. #endif
  7.  
  8. #ifndef _IRESLIB_
  9.   #include <ireslib.hpp>
  10. #endif
  11.  
  12. #ifndef _IAPP_
  13.   #include <iapp.hpp>
  14. #endif
  15.  
  16. /*---------------------------------------------------------------
  17.  * Name: KLibrary
  18.  * 
  19.  * Implementation File: N/A
  20.  * 
  21.  * Purpose: This class exists to simplify setting and restoring
  22.  *          the user resource library for an application.  It 
  23.  *          allows User Interface Class Library objects to reside
  24.  *          in, and obtain resources from, a DLL.
  25.  *
  26.  * Base Classes: KLibrary is derived from IBase.
  27.  *
  28.  * Notes:   
  29.  *-------------------------------------------------------------*/
  30. class KLibrary : public IBase
  31. {
  32.    public:
  33.       KLibrary(IResourceLibrary &library)
  34.         : _saved(IApplication::current().userResourceLibrary())
  35.       {
  36.          IApplication::current().setUserResourceLibrary(library);
  37.       }
  38.  
  39.       ~KLibrary()
  40.       {
  41.          IApplication::current().setUserResourceLibrary(_saved);
  42.       }
  43.  
  44.    private:
  45.       IResourceLibrary& _saved;
  46. };
  47.  
  48. #endif
  49.