The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ragdog on December 19, 2006, 09:20:46 PM

Title: i have drouble with editbox
Post by: ragdog on December 19, 2006, 09:20:46 PM
it´s me again ::)

how can i determine that my inputbuffer dose´nt limit my outputbox in 511 chars .
i want it without delimitation.

.data?
hInput  db 512 dup (?)

.code
...
..
invoke GetDlgItemText,hWnd,IDE_INPUT,addr hInput,sizeof hInput
invoke SetDlgItemText,hWnd,IDE_OUTPUT,addr hInput

thanks in for forward
ragdog
Title: Re: i have drouble with editbox
Post by: ramguru on December 19, 2006, 09:48:18 PM
I think the easiest way is to use alloc$ and free$ macros (from macros.asm) like this:

invoke SendDlgItemMessage, ..., WM_GETTEXTLENGTH, 0, 0
inc    eax ; terminating zero
mov    ln, eax
mov    pString, alloc$ eax ; pString is DWORD
invoke SendDlgItemMessage, ..., WM_GETTEXT, ln, pString

;when buffer not needed
..
free$ pString

Title: Re: i have drouble with editbox
Post by: ragdog on December 20, 2006, 07:55:58 PM
thanks

i have a compile problem with this

invoke SendDlgItemMessage,hWnd,IDE_INPUT, WM_GETTEXTLENGTH, 0, 0
inc    eax ; terminating zero
mov    ln, eax
mov    hInput, alloc$ eax ; pString is DWORD   ;;<< error A2206: missing operator in expression


invoke SendDlgItemMessage, hWnd,IDE_INPUT, WM_GETTEXT,ln,hInput

can anyone help me
Title: Re: i have drouble with editbox
Post by: ramguru on December 20, 2006, 08:01:42 PM
Yes, indeed I haven't tested it... should be:
mov  eax, alloc(eax)
Title: Re: i have drouble with editbox
Post by: ragdog on December 20, 2006, 08:03:42 PM
I solved the problem evenly :bg

thanks for your help and the fix posting

great :U

ragdog