flat assembler
Message board for the users of flat assembler.

Index > Windows > Undefined Symbol

Author
Thread Post new topic Reply to topic
Daedalus



Joined: 25 Mar 2007
Posts: 52
Daedalus
Hey c0ders. Very Happy

I was trying to create my own dialog box, working from the example "DIALOG.ASM", just copied the code and left out what I thought I wouldn't need and kept in what I think would need. Allas I deleted a bit too much or included something that I should not include, I have a problem!

Here's the code:
Code:
format PE GUI 4.0
entry start

include 'win32a.inc'

section '.data' data readable writeable
  checkthis db 1Fh

section '.code' code readable executable

  start:
        invoke  GetModuleHandle,0
        invoke  DialogBoxParam,eax,37,HWND_DESKTOP,DialogProc, 0
        or      eax,eax
        jz      exit
  exit:
        invoke  ExitProcess,0

proc DialogProc hwnddlg,msg,wparam,lparam
        push    ebx esi edi
        cmp     [msg],WM_INITDIALOG
        je      wminitdialog
        cmp     [msg],WM_COMMAND
        je      wmcommand
        cmp     [msg],WM_CLOSE
        je      wmclose
        xor     eax,eax
        jmp     finish
  wminitdialog:
        jmp     processed
  wmcommand:
        cmp     [wparam],BN_CLICKED shl 16 + IDEXIT
        je      wmclose
        cmp     [wparam],BN_CLICKED shl 16 + IDOK
        jmp     processed
  wmclose:
        invoke  EndDialog,[hwnddlg], 0
  processed:
        mov     eax, 1
  finish:
        pop     edi esi ebx
        ret

endp

section '.idata' import data readable writeable

  library kernel,'KERNEL32.DLL',\
          user,'USER32.DLL'

  import  kernel,\
          GetModuleHandle,'GetModuleHandleA',\
          ExitProcess,'ExitProcess'

  import  user,\
          DialogBoxParam,'DialogBoxParamA',\
          GetDlgItemText,'GetDlgItemTextA',\
          MessageBox,'MessageBoxA',\
          EndDialog,'EndDialog'

section  '.rsrc' resource data readable

  directory RT_DIALOG,dialogs

  resource dialogs,\
           37, LANG_ENGLISH+SUBLANG_DEFAULT,mydialog

  dialog mydialog,'Clockowl - First Dialogbox',6,6,239,44,10CF0000h
    dialogitem 'EDIT','Yeey, it works!',IDTEXT,4,5,230,15,00000001h
    dialogitem 'BUTTON','&Ok',IDOK,152,25,82,13,50010000h
    dialogitem 'BUTTON','E&xit',IDEXIT,4,25,82,13,50010000h
  enddialog
    


As the title says, I get an undefined symbol error at the wmcommand: first line (which is line 24).
I don't get what the error means (not completely, I think it says I forgot to initialize something in the .data section (or anywhere else for that matter) but I can't figure out what)

Thanks in advance,
Daedalus
Post 25 Mar 2007, 20:13
View user's profile Send private message MSN Messenger Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7802
Location: Kraków, Poland
Tomasz Grysztar
You did not define the IDEXIT value.
Add somewhere into your code a line like:
Code:
IDEXIT = 100    

And same for IDTEXT and other non-predefined IDs you use (IDOK is a predefined one).
Post 25 Mar 2007, 20:44
View user's profile Send private message Visit poster's website Reply with quote
Daedalus



Joined: 25 Mar 2007
Posts: 52
Daedalus
Ah thanks a lot. Smile
Post 25 Mar 2007, 20:55
View user's profile Send private message MSN Messenger Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
Flew too close to the sun, did ya? Laughing (sorry, cheesy, I know)
Post 29 Mar 2007, 02:29
View user's profile Send private message Visit poster's website Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6038
Location: Poland
MHajduk
rugxulo wrote:
Flew too close to the sun, did ya? Laughing (sorry, cheesy, I know)
No, it was his son Icarus. Very Happy
Post 29 Mar 2007, 10:00
View user's profile Send private message Visit poster's website Reply with quote
Daedalus



Joined: 25 Mar 2007
Posts: 52
Daedalus
Hehe, yeah, I built this bigass maze with a minotaur, then some temple to apollo, left my wings there. Wink
Post 29 Mar 2007, 15:31
View user's profile Send private message MSN Messenger Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
MHajduk wrote:
rugxulo wrote:
Flew too close to the sun, did ya? Laughing (sorry, cheesy, I know)
No, it was his son Icarus. Very Happy


Yes, I know, but his son didn't post here so Razz Razz Razz
Post 31 Mar 2007, 03:49
View user's profile Send private message Visit poster's website 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.