"D++" asked:
> I do not know how to use the text field feature in C++.
> I would like to enter a word in the text field which can
> be used as a variable in the program. An example would be
> when the user enters a password in the text field, if it
> matches with what the program is expecting then something
> else happens, for example he can log in.
There is no feature of C++ called "text field". If you
mean a control in a window, that's a feature of the API
for your operating system. Read the manual, or ask in a
group for your OS. Since I don't know what OS you're using,
I can't give a specific answer.
But generally, your OS's API will have some function,
like "GetCtrlVal" (CVI) that gets the value of a control.
You pass the address of the variable you want to recieve
the value (along with window handle and control ID) to
the API function, and it will load the value into the
variable.
An example from CVI (a National Instruments compiler
with its own GUI and API to Microsoft Windows):
GetCtrlVal // get value from control...
(
panel, // on this panel...
control, // with this control ID...
(void*)CustomInputName // and put in this variable.
);
Or from the Microsoft Windows Win32 API:
UINT GetDlgItemText(
HWND hDlg, // handle to dialog box
int nIDDlgItem, // control identifier
LPTSTR lpString, // pointer to buffer for text
int nMaxCount // maximum size of string
);
But with other APIs, the method may look quite different.
--
Cheers,
Robbie Hatley
lone wolf aatt well dott com
triple-dubya dott Tustin Free Zone dott org