flat assembler
Message board for the users of flat assembler.

Index > Windows > sndPlaySoundA

Author
Thread Post new topic Reply to topic
HarryTuttle



Joined: 26 Sep 2003
Posts: 211
Location: Poland
HarryTuttle
Code:
include '%fasminc%/win32ax.inc'

.data
 plik db 'muz.wav',0

.code
start:
invoke sndPlaySound,plik,0x20009 ;asynch_loop_from-wav
invoke ExitProcess ,0
.end            start
;------------IMPORTS---------------
;||||||||||||||||||||||||||||||||||
library winmm,'winmm.dll'
import winmm,\
       sndPlaySound,'sndPlaySoundA'
    


it gives me an error.
the instruction at "0x00003085' reference memory at "0x00003085". The memory could not be "read"


but I can't find the bug...

_________________
Microsoft: brings power of yesterday to computers of today.
Post 23 Dec 2003, 07:47
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
i think error is that you didnt declare import data for winmm in import section Smile . Library and import macros create data, which, if they were in import section will cause winmm to load. But unfortunately they arent in import section Crying or Very sad .dont use win32axp, use win32a and declare import section yourself.
Post 23 Dec 2003, 20:08
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
HarryTuttle



Joined: 26 Sep 2003
Posts: 211
Location: Poland
HarryTuttle
U R Right but I thought that after .end start is there place for my imports, is not it thrue?

THX for your advice , it was the right reason.
Smile
best regards,
harry

_________________
Microsoft: brings power of yesterday to computers of today.
Post 24 Dec 2003, 21:39
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
yes, data behind .end is still in import section, but 'library' has effect only when it is first data in section, so it is of no use for you.I better dont use AXP include, for this reason.

btw: include files may change and there is no promise that import section will remain last in future includes.
Post 24 Dec 2003, 21:44
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number 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.