home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / gotch175.zip / src / rstring.cpp < prev    next >
C/C++ Source or Header  |  2002-03-29  |  1KB  |  42 lines

  1. /***
  2.  This file belongs to the Gotcha! distribution.
  3.  Copyright (C) 1998-2002 Thorsten Thielen <thth@gmx.net>
  4.  
  5.  This program is free software; you can redistribute it and/or modify
  6.  it under the terms of the GNU General Public License as published by
  7.  the Free Software Foundation; either version 2 of the License, or
  8.  (at your option) any later version.
  9.  
  10.  This program is distributed in the hope that it will be useful,
  11.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  GNU General Public License for more details.
  14.  
  15.  You should have received a copy of the GNU General Public License
  16.  along with this program; if not, write to the Free Software
  17.  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18.  ***/
  19.  
  20. #include "rstring.h"
  21.  
  22. HMODULE  ResourceString :: hmod = NULLHANDLE;
  23.  
  24. ResourceString :: ResourceString (ULONG Id) : psz ("(string load error)")
  25. {
  26.     SavedId = Id;
  27.  
  28.     if (DosGetResource (Module(), RT_STRING, Id/16+1, &BlockPointer))
  29.         return;
  30.  
  31.     psz = PSZ (BlockPointer) + sizeof(USHORT);
  32.  
  33.     USHORT Index = USHORT (Id % 16);
  34.     while (Index--)
  35.     {
  36.         psz += * PUCHAR (psz);
  37.         psz ++;
  38.     }
  39.  
  40.     psz ++;
  41. }
  42.