|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Question concerning visual c++ 6.0
I have been messing around with visual c++ 6.0 and I was wondering how I can store what a user puts in an input box into a variable. Later when the user hits like maybe add(if its a calculator) a message box will be displayed with the sum of the two numbers the user inputed. I have Sams Teach yourself Visual C++ 6.0 but I haven't found in the book how to do this. Thanks for all help and advice provided.
|
|
#2
|
|||
|
|||
|
something like (MFC):
char *str=myCWnd->EditField1->GetText(); or for API programming: char *str=SendMessage(InputForm->EditField1->Handle, WM_GETTEXT, 0, 0); i am not sure about the syntax as i am not doing any GUI windows programming in C/C++, but shouldn´t this be trivial...?
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
|
#3
|
|||
|
|||
|
>>I was wondering how I can store what a user puts in an input box into a variable
Process the WM_COMMAND msg for the control Different type of control have different msg's. Code:
case WM_COMMAND:
idControl = GET_WM_COMMAND_ID( wParam, lParam) ;
switch(idControl)
{
case ID_INPUT_BOX:
//is a button
if(BN_CLICKED == HIWORD(wParam))
//is an edit
if (EN_CHANGE == HIWORD(wParam))
__________________
The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions. Frank Zappa |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > Question concerning visual c++ 6.0 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|