flat assembler
Message board for the users of flat assembler.

Index > Windows > Weird Error

Author
Thread Post new topic Reply to topic
roticv



Joined: 19 Jun 2003
Posts: 374
Location: Singapore
roticv 19 Mar 2004, 12:16
Hi,

I use the following code

Code:
  proc MessageWindow,hwnddlg, msg, wparam, lparam
        enter
        mov     eax, [msg]
        cmp     eax, WM_INITDIALOG
        jz      .wminitdialog_msg
        cmp     eax, WM_COMMAND
        je      .wmcommand_msg
        cmp     eax, WM_CLOSE
        jz      .wmclose_msg
        cmp     eax, WM_SETCLASS
        jz      .wmsetclass_msg
        cmp     eax, WM_SENDMSG
        jz      .wmsendmsg_msg
  .end_msg:
        xor     eax, eax
        return
  .wmclose_msg:
        invoke  EndDialog,[hwnddlg],0
        jmp     .end_msg
  .wminitdialog_msg:
        invoke  LoadIcon, hinstance, 16
        invoke  PostMessage, [hwnddlg],WM_SETICON, ICON_SMALL, eax
  .wmcommand_msg:
        mov     eax, [wparam]
        cmp     eax,1014
        je      .wmclose_msg
        jmp     .end_msg
  .wmsetclass_msg:
        invoke  SetWindowLong, [hwnddlg], DWL_USER, [lparam]
        jmp     .end_msg
  .wmsendmsg_msg:
        invoke  GetWindowLong, [hwnddlg], DWL_USER
        xchg    eax, ebx
        lea     eax, [lvfi]
        mov     [eax+LV_FINDINFO.flags],LVFI_PARAM
        mov     [eax+LV_FINDINFO.lParam], ebx
        invoke  SendMessage,[hList],LVM_FINDITEM,-1, eax
        cmp     eax, -1
        jnz     @F
        ;;;;;;;;convert dword to string here
        jmp     _addmsg
    @@:
        mov     [lvi.iItem], eax
        mov     [lvi.pszText], cookie
        mov     [lvi.cchTextMax], 30h
        invoke  SendMessage,[hList],LVM_GETITEM,0,lvi
        push    -2
        push    -1
        invoke  SendDlgItemMessage,[hwnddlg], 1011, EM_EXSETSEL,0,esp
        add     esp, 8
    _addmsg:
        invoke  SendDlgItemMessage,[hwnddlg], 1011, EM_REPLACESEL,0,cookie
        invoke  SendDlgItemMessage,[hwnddlg], 1011, EM_REPLACESEL,0,formatting
        invoke  SendDlgItemMessage,[hwnddlg], 1011, EM_REPLACESEL,0,[lparam]
        invoke  SendDlgItemMessage,[hwnddlg], 1011, EM_REPLACESEL,0,formatting
        jmp     .end_msg  
    

The problem is that fasm complains that on the last line, Error: undefined symbol, instruction: jmp .end_msg.. Any explanation is welcomed.
Post 19 Mar 2004, 12:16
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 19 Mar 2004, 12:28
This is because of label _addmsg that becomes root for .end_msg
The last line is then "jmp _addmsg.end_msg"
Post 19 Mar 2004, 12:28
View user's profile Send private message Yahoo Messenger Reply with quote
roticv



Joined: 19 Jun 2003
Posts: 374
Location: Singapore
roticv 19 Mar 2004, 12:30
Thanks...
Post 19 Mar 2004, 12:30
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.