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

A.4: An Input Dialogue Box

A.4 An Input Dialogue Box

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, "");          ...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Logarithmic Amplifier Chips
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.