News:

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

pls help about this if you can

Started by mkdev, February 04, 2007, 01:49:14 PM

Previous topic - Next topic

mkdev

pls help about this if you can   

MOV                ESI,OFFSET LOC_00416F58     "unikey-123132"- i whant to set this   in the dialog but  i get some error for that ?
pls help  :red thanks

i  ?
TEST               EAX,EAX
JLE                LOC_00405DAE
MOV                ECX,DWORD PTR [ESP+018h]
MOV                ESI,OFFSET LOC_00416F58
          mov  edi, esi
LOC_00405DAE: ;Ref: 00405D5B
     
      INVOKE SetDlgItemText, hWnd, IDC_SERIAL,esi




dsouza123

If the string (zero terminated) is in the .data section then the following would work.

.data
  szKey  db "unikey-123132",0


.code
  INVOKE SetDlgItemText, hWnd, IDC_SERIAL, ADDR szKey

mkdev


.DATA


LOC_0040F34C    dd        020030424h
LOC_00413C5C   TCHAR    'UNIKEY-%08X',0   


INVOKE SetDlgItemText, hWnd, IDC_SERIAL, ADDR szKey

still same not working ?? im confuesd ??

dsouza123

Not sure what TCHAR is but at the very least

the code

INVOKE SetDlgItemText, hWnd, IDC_SERIAL, ADDR szKey    ; szKey was just an example, your variable name needs to be used

would be

INVOKE SetDlgItemText, hWnd, IDC_SERIAL, ADDR LOC_00413C5C

mkdev

look the code i get ok number , but i when is CALL _SetDlgItemTextA@12h (INVOKE SetDlgItemText, hWnd, IDC_SERIAL, LOC_00413C5C)    i get error
how set the number to the dialog ?   :eek thanks for helping me 


  MOV EDX,DWORD PTR DS:[LOC_0040F34Ch]
  OR EDX,ECX
  PUSH EDX
  PUSH LOC_00413C5Ch
  PUSH LOC_00416F58h
  CALL _wsprintfAh
  ADD ESP,0Ch
  PUSH LOC_00416F58h
  CALL _lstrlenW@4h
  MOV ECX,DWORD PTR SS:[ESP+1Ch]
  CMP EAX,ECX
  JLE L013
  MOV EAX,ECX
L013:
  TEST EAX,EAX
  JLE L017
  MOV ECX,DWORD PTR SS:[ESP+18h]
  MOV ESI,LOC_00416F58h                        (ASCII "UNIKEY-20030424")
L017:
  PUSH 0h
  MOV AL,BYTE PTR DS:[LOC_00413C5Ch]       
  MOVZX AX,AL
  PUSH AX
  PUSH 195h
  PUSH DWORD PTR SS:[EBP+8h]
  CALL _SetDlgItemTextA@12h
  MOV EAX,1h
  JMP L031
  PUSH ??001Bh
  PUSH 195h
  PUSH DWORD PTR SS:[EBP+8h]
  CALL _SetDlgItemTextA@12h
  MOV EAX,0h
L031:
  POP EDI
  POP ESI
  POP EBX
  LEAVE
  RET 4h

dsouza123

A good example of SetDlgItemText is the dialog.asm and rsrc.rc files
from Iczelion's tutorial 10-2 that comes with MASM32.

The tutorials are a very good place to look for readable working code
that target various common topics.

rags

If I understand your question correctly, If you want to send a number to the control on the dialog you would use:

invoke SetDlgItemInt ,hWnd, IDC_SERIAL, ADDR LOC_00413C5C, FALSE ;<-true if you want a signed number


regards,
     Rags
God made Man, but the monkey applied the glue -DEVO

BogdanOntanu

mkdev,

The code you show here looks very much like a dis assembly of a program that you did not write...
This is against the rules ... please explain :D

Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

mkdev


Tedd

No snowflake in an avalanche feels responsible.

hutch--

The answer of being a beginner is not satisfactory under the forum rules so the topic hasd been closed.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php