;--------------------------------------------------------------------------------

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...
_________________
Posted on 2003-12-23 01:59:47 by HarryTuttle
try

invoke sndPlaySound,addr plik,0x20009 ;asynch_loop_from-wav


and muz.wav must stay in the same dir of your exe :)

Bye Bit7
Posted on 2003-12-23 05:16:50 by Bit7

try

invoke sndPlaySound,addr plik,0x20009 ;asynch_loop_from-wav


and muz.wav must stay in the same dir of your exe :)

Bye Bit7



Hi Bit7,


yes, here it is in the same folder but there must be different reason that it doesn't work.


thx anyway,
suggestion?
Posted on 2003-12-23 07:21:55 by HarryTuttle
have you change "plik" parameter to "addr plik" ? You have to specify the offset of the string, not the content.

Post back if this don't solve.

B7
Posted on 2003-12-23 12:45:02 by Bit7
Mate, he is using fasm. That code does push pointer to plik onto the stack. Variables have to be enclosed with brackets if not it would taken as offset.
Posted on 2003-12-23 12:48:59 by roticv
hi friends, it was my mistake, I did not declare impotr section and the windows gives me warrning :that the place in memory could not be read.


THX the men from slovakia for good suggestion
Posted on 2003-12-23 17:17:42 by HarryTuttle