home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 15 / CD_ASCQ_15_070894.iso / vrac / memsz231.zip / RESTRING.H < prev    next >
Text File  |  1993-12-08  |  1KB  |  50 lines

  1. // Class RESTRING: Encapsulates the load/discard
  2. //   logic for a resource String Table entry.
  3.  
  4. #define INCL_BASE
  5. #include <os2.h>
  6.  
  7. class ResourceString
  8. {
  9.   private:
  10.     HMODULE SavedModule ;
  11.     ULONG SavedId ;
  12.  
  13.     PVOID BlockPointer ;
  14.     PSZ StringPointer ;
  15.  
  16.   public:
  17.     // Constructor
  18.     ResourceString ( HMODULE Module, ULONG Id ) ;
  19.  
  20.     // Copy Constructor
  21.     ResourceString ( const ResourceString & Object )
  22.     {
  23.       SavedModule   = Object.SavedModule ;
  24.       SavedId       = Object.SavedId ;
  25.       BlockPointer  = Object.BlockPointer ;
  26.       StringPointer = Object.StringPointer ;
  27.     }
  28.  
  29.     // Typecast Operators
  30.     operator PSZ ()
  31.     {
  32.       return ( StringPointer ) ;
  33.     }
  34.  
  35.     operator PCHAR ()
  36.     {
  37.       return ( PCHAR(StringPointer) ) ;
  38.     }
  39.  
  40.     // Assignment Operator
  41.     ResourceString & operator= ( const ResourceString & Object )
  42.     {
  43.       SavedModule   = Object.SavedModule ;
  44.       SavedId       = Object.SavedId ;
  45.       BlockPointer  = Object.BlockPointer ;
  46.       StringPointer = Object.StringPointer ;
  47.       return ( *this ) ;
  48.     }
  49. } ;
  50.