An Introduction to Numerical Methods in C++, Revised Edition

In Windows, just as in DOS, we have much need for keyboard input, of integers, floating point numbers, and strings. In Windows this is achieved by means of Input Dialogue Boxes. We shall illustrate the general technique by building a dialogue box for strings. We begin by declaring a function SetString in the class TMyWindow:
class TMyWindow : public TWindow { public: TMyWindow (PTWindowsObject AParent, LPSTR ATitle): TWindow (AParent, ATitle) { }; void SetString (LPSTR Str, LPSTR Caption); virtual void Paint (HDC PaintDC, PAINTSTRUCT &PaintInfo); }; The function takes two parameters: a pointer to the string that is to be entered; and a caption for the dialogue box. We define it as follows:
void TMyWindow: :SetString (LPSTR Str, LPSTR Caption) { char Buffer [20]; strcpy (Buffer, ""); ...