source: trunk/rstring.h@ 10

Last change on this file since 10 was 10, checked in by Gregg Young, 8 years ago

The changes in these files were made to fix Open Watcom compiler, WRC and wipfc errors and warning. There are several more in the next commit.

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1/***
2 This file belongs to the Gotcha! distribution.
3 Copyright (C) 1998-2002 Thorsten Thielen <thth@c2226.de>
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#ifndef _RSTRING_H_
21#define _RSTRING_H_
22
23//#define OS2EMX_PLAIN_CHAR
24#define INCL_DOSMODULEMGR
25
26#include <os2.h>
27
28#define RSTR(id) ResourceString(id)
29
30class ResourceString
31{
32public:
33 ResourceString (ULONG Id);
34
35 ResourceString (const ResourceString &rstr)
36 {
37 SavedId = rstr.SavedId;
38 BlockPointer = rstr.BlockPointer;
39 psz = rstr.psz;
40 }
41
42 operator unsigned char * () { return ((unsigned char *) psz); }
43 operator char * () { return ((char *) psz); }
44
45 ResourceString & operator= (const ResourceString &rstr)
46 {
47 SavedId = rstr.SavedId;
48 BlockPointer = rstr.BlockPointer;
49 psz = rstr.psz;
50 return (*this);
51 }
52
53 static VOID Module (HMODULE hmod) { ResourceString::hmod = hmod; }
54
55protected:
56 static HMODULE Module (VOID) { return hmod; }
57
58private:
59 ULONG SavedId;
60
61 PVOID BlockPointer;
62 PSZ psz;
63
64 static HMODULE hmod;
65};
66
67#endif
Note: See TracBrowser for help on using the repository browser.