News:

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

DWORD Problem

Started by ragdog, June 06, 2008, 09:46:59 PM

Previous topic - Next topic

ragdog

hi

i have a little problem with my routine

with convert from getdlgitemtext

expl: gettext dll convert to .dll or anything


.data?
hExtension db 4 dup (?)
lpszBuffer dd ?

.code
        invoke GetDlgItemText,hWnd,IDC_EXT,addr hExtension,sizeof hExtension
       
       mov eax,offset lpszBuffer
       mov esi,4
       mov byte PTR [eax],"."
       mov DWORD PTR [eax+esi],offset hExtension
       
        invoke MessageBox,hWnd,offset lpszBuffer,0,MB_OK


thanks
ragdog


jdoe


ragdog


jj2007

Your code assembles without errors, but without the context I can't guess what your problem is...

ragdog

hi

   
enter into the field 3 signs example dll or txt ...

this routine works not to convert the dll > .dll or txt > .txt

have your an idea

jj2007

Which field? Post the complete code if you want help.

ragdog

ohh sorry i forgot it  :bg

[attachment deleted by admin]

jdoe


Sorry I removed my post because I misread what you are trying to do because a string in a dword will be in reverse order.

Why not using a string buffer...



.data?

lpszBuffer db 8 dup (?)

.code

mov eax, offset lpszBuffer
mov byte ptr [eax], "."
inc eax

invoke GetDlgItemText, hWnd, IDC_EXT, eax, sizeof lpszBuffer

invoke MessageBox, hWnd, addr lpszBuffer, 0, MB_OK





jj2007

jdoe's solution works probably. Here is another variant.

.data?
hExtension db 5 dup (?)
; lpszBuffer dd ?

.code
       mov eax,offset hExtension+1   ; EDIT
       mov byte PTR [eax-1],"."
       invoke GetDlgItemText,hWnd,IDC_EXT,eax, 3
       invoke MessageBox,hWnd, addr hExtension,0,MB_OK

ragdog

thanks :U

hmm     
why I am  not to come of this simply solution
and I tried it the whole time otherwise ::)

great thanks
ragdog

PBrennick

ragdog,
Sometimes that is just the way it is. You stare and stare at the same piece of code and want to rip your hair out! Don't let it get you down, it happens to all of us at one time or another.
Paul
The GeneSys Project is available from:
The Repository or My crappy website

ragdog

Thank you for your understanding

greets
ragdog