News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

A squence of characters in EditBox

Started by voidguide, June 03, 2006, 09:58:00 PM

Previous topic - Next topic

voidguide

Hi, everybody. I have an editbox which has initial value set to 0 (it's a simple calc I'm trying to write). How do I implement the following analog written in C#:

.
.
.
tbDigitField.Text += btnOne.Text;
tmp = Convert.ToDouble(tbDigitField.Text);
.
.
.
tbDigitField.Text += btnTwo.Text;
tmp = Convert.ToDouble(tbDigitField.Text);

Actually, I have these lines:
.
.
.
.elseif eax == IDC_BTN_TWO
                invoke   lstrcpy, addr szBuffer, offset szBtnOne       ; szBtnOne db '1',0    
                invoke    SendMessage, hDgtFld, WM_SETTEXT, 0, addr szBuffer         
.elseif eax == IDC_BTN_TWO
                invoke   lstrcpy, addr szBuffer, offset szBtnTwo      ; szBtnTwo db '2',0
                invoke   SendMessage, hDgtFld, WM_SETTEXT, 0, addr szBuffer
.
.
.
I am at a loss... How to save those numbers in szBuffer? Say, when 1 is pressed EditBox shows 1, then again 1 - EditBox has 11, then 2 - 112 and so on?

TIA.

dsouza123

The following API function will get the text from an editbox
with a maximum of 511 chars and place it in a char buffer.

You will have to parse the text for numeric chars and once cleaned up
invoke one of the text to binary number conversion routines.

.data
  szBuffer db 512 dup (0)

.code
  invoke GetDlgItemText,hWnd,IDC_EDIT,ADDR szBuffer,511