flat assembler
Message board for the users of flat assembler.

Index > Windows > winmm.dll asm programing

Author
Thread Post new topic Reply to topic
tutenhamon



Joined: 16 Jan 2010
Posts: 27
Location: Polska (Poland)
tutenhamon 17 Jan 2010, 01:27
Why it does not act

Code:
include 'INCLUDE\win32ax.inc' 

.code

  start:
    invoke  MessageBox,NULL,<'Wszystko zniknBo?',10,13,'DzieBo Twojego |ycia zostaBo unicestwione.',10,13,'Pocign za spust?'>,NULL,MB_YESNO+MB_ICONQUESTION

 cmp eax, IDYES
      jne nobut
           invoke  MessageBox,NULL,"BUUM",NULL,MB_OK+MB_ICONERROR
    nobut:
  cmp eax, IDNO
       jne exit
            invoke  mciSendString,"open cdaudio",0,0,0
                invoke  mciSendString,"set cdaudio door open",0,0,0
               invoke  mciSendString,"close cdaudio",0,0,0
       exit:
   invoke  ExitProcess,0

.end start

library winmm,'WINMM.DLL'

 import winmm,\
  mciSendString,'mciSendStringA'
    


This code had to open cdrom if press a NO click
But not crash Sad
J don't know that is a problem?
impor section?
Post 17 Jan 2010, 01:27
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 17 Jan 2010, 02:19
Yes, the import section is wrong. You'll have to repace ".end start" with "entry start" (you could put this earlier too), and also add this:
Code:
data import
 library kernel32,'KERNEL32.DLL',\
         user32,'USER32.DLL',\
         winmm,'WINMM.DLL'  

  include 'API\KERNEL32.inc'
  include 'API\USER32.inc'
  import winmm,\
        mciSendString,'mciSendStringA'
end data    
Post 17 Jan 2010, 02:19
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-2023, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.