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 25 Mar 2007, 20:13
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: 8356
Location: Kraków, Poland
Tomasz Grysztar 25 Mar 2007, 20:44
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 25 Mar 2007, 20:55
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 29 Mar 2007, 02:29
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: 6115
Location: Poland
MHajduk 29 Mar 2007, 10:00
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 29 Mar 2007, 15:31
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 31 Mar 2007, 03:49
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.