Author Topic: Why it's don't working? (in masm32)  (Read 3854 times)


  • Posts: 2
Why it's don't working? (in masm32)
« on: 19 Feb '03 - 23:00 »
I write simple programm on masm32, using BASS.dll:
.model flat,stdcall
option casemap:none
include \masm32\include\
include \masm32\include\
include \masm32\include\
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
include \masm32\include\
includelib \masm32\lib\comdlg32.lib
include \masm32\include\
includelib \masm32\lib\bass.lib
include \masm32\include\
includelib \masm32\lib\masm32.lib

szOpen         db "Open A File",0
szFiles        db "MP3 Files",0,"*.mp3",0,0

Channel dd ?
hWnd          dd ?
hInstance     dd ?
ofn           OPENFILENAME <>
szFileName db 256 dup (?)

     invoke GetModuleHandleA,NULL
     mov hInstance,eax
         mov szFileName[0],0     ; set 1st byte to zero

           mov ofn.lStructSize, sizeof OPENFILENAME
           m2m ofn.hWndOwner,   hWnd
           m2m ofn.hInstance,   hInstance
           m2m ofn.lpstrFilter, offset szFiles            
           m2m ofn.lpstrFile, offset szFileName
           mov ofn.nMaxFile,    sizeof szFileName
           m2m ofn.lpstrTitle,  offset szOpen
           mov ofn.Flags,       OFN_EXPLORER or OFN_FILEMUSTEXIST or \
           invoke GetOpenFileName,ADDR ofn
           invoke BASS_Init,-1, 44100, 0,hInstance
           mov Channel,eax
         invoke BASS_Start
         invoke BASS_StreamCreateFile,FALSE,addr szFileName,0,0,0
         invoke BASS_StreamPlay, eax, FALSE, 0
         invoke BASS_ErrorGetCode
BASS_ErrorGetCode - return 00000004
in - "BASS_ERROR_BUFLOST      equ 4   ; the sample buffer was lost - please report this!"

What is this?
Why my mp3 not plaing?
« Last Edit: 19 Feb '03 - 23:02 by DemoN »

Ian @ un4seen

  • Administrator
  • Posts: 20672
Re: Why it's don't working? (in masm32)
« Reply #1 on: 20 Feb '03 - 16:08 »
           invoke BASS_Init,-1, 44100, 0,hInstance

The "win" parameter should be a window handle, not the module handle/base address. You could try using "0" if you don't have a window - that may (or may not :)) work.


  • Posts: 2
Re: Why it's don't working? (in masm32)
« Reply #2 on: 20 Feb '03 - 22:56 »
O yes,thank you!
I try using this in windows, and it's work OK!
But invoke BASS_Init,-1, 44100,0,0 (with no window) don't work :(