January 31st, 2003, 03:21 PM
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.
January 31st, 2003, 03:42 PM
something like (MFC):
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...?
February 4th, 2003, 11:54 PM
>>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.
idControl = GET_WM_COMMAND_ID( wParam, lParam) ;
//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.