flat assembler
Message board for the users of flat assembler.

Index > Main > A problem about fasm

Author
Thread Post new topic Reply to topic
zjlcc



Joined: 23 Jul 2003
Posts: 32
Location: china
zjlcc 28 Mar 2004, 13:41
in TEMPLATE.ASM
..........
mov [wc.lpszClassName],_class
invoke RegisterClass,wc

invoke CreateWindowEx,0,_class,_title,WS_VISIBLE+WS_DLGFRAME+WS_SYSMENU,128,128,192,192,NULL,NULL,[hinstance],NULL
mov [mainhwnd],eax
invoke closewindow,eax ;<=======add it
msg_loop:
invoke GetMessage,msg,NULL,0,0
..........

error msg:

flat assembler version 1.52 beta 1
TEMPLATE.ASM [102]:
invoke closewindow,0
F:\汇编\fasm\INCLUDE\/macro/stdcall.inc [42] invoke [2]:
stdcall [proc],arg
F:\汇编\fasm\INCLUDE\/macro/stdcall.inc [37] stdcall [3]:
call proc }
error: undefined symbol.
Post 28 Mar 2004, 13:41
View user's profile Send private message Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 28 Mar 2004, 14:04
in this example you have to specify each funcion that you import. See the last lines of this file:
Code:
  import user,\
         RegisterClass,'RegisterClassA',\
         CreateWindowEx,'CreateWindowExA',\
(and so on...)
    


If you want to use CloseWindow API, you have to add this function there:
Code:
  import user,\
         RegisterClass,'RegisterClassA',\
         CreateWindowEx,'CreateWindowExA',\
         CloseWindow,'CloseWindow',\                ;  <----
         DefWindowProc,'DefWindowProcA',\
         GetMessage,'GetMessageA',\
         TranslateMessage,'TranslateMessage',\
         DispatchMessage,'DispatchMessageA',\
         LoadCursor,'LoadCursorA',\
         LoadIcon,'LoadIconA',\
         PostQuitMessage,'PostQuitMessage'    

Remember that FASM is case-sensitive so you when you declare import like above, instead of
Code:
invoke closewindow,eax    

you have to use
Code:
invoke CloseWindow,eax    


Also, you don't have to add your imports manually. The import section can look like this:
Code:
section '.idata' import data readable writeable
  library kernel,'KERNEL32.DLL',\
          user,'USER32.DLL'

  include '%fasminc%/apia/kenrel32.inc'
  include '%fasminc%/apia/user32.inc'
    

... and you will have all functions from kernel.dll and user.dll available.

regards
Post 28 Mar 2004, 14:04
View user's profile Send private message Visit poster's website Reply with quote
zjlcc



Joined: 23 Jul 2003
Posts: 32
Location: china
zjlcc 28 Mar 2004, 17:21
Embarassed
thanks for your reply!

thank you!!!
Post 28 Mar 2004, 17:21
View user's profile Send private message 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.