2 * Copyright (c) 2001, Gary R. Van Sickle.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * A copy of the GNU General Public License can be found at
12 * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
16 // Yep, another string class
22 cistring::Format (UINT i
, ...)
24 TCHAR FormatStringBuffer
[256];
29 // Get the string from the stringtable (FormatMessage() can only work with
30 // literal strings or *message*table entries, which are different for some
31 // inexplicable reason).
32 LoadString (GetModuleHandle (NULL
), i
, FormatStringBuffer
, 256);
34 va_start (arglist
, i
);
36 FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER
|
37 FORMAT_MESSAGE_FROM_STRING
, FormatStringBuffer
, i
, 0,
38 (LPTSTR
) & Buff
, 0, &arglist
);
43 // Something went wrong.
47 buffer
= new TCHAR
[(numchars
+ 1) * sizeof (TCHAR
)];
48 memcpy (buffer
, Buff
, (numchars
+ 1) * sizeof (TCHAR
));