News:

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

i have drouble with editbox

Started by ragdog, December 19, 2006, 09:20:46 PM

Previous topic - Next topic

ragdog

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

ramguru

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


ragdog

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

ramguru

Yes, indeed I haven't tested it... should be:
mov  eax, alloc(eax)

ragdog

I solved the problem evenly :bg

thanks for your help and the fix posting

great :U

ragdog