Author Topic: [vb6] ChannelSetSync crash  (Read 10821 times)

Crazy_2000

  • Guest
[vb6] ChannelSetSync crash
« on: 7 Jul '04 - 03:29 »
the BASS_ChannelSetSync on vb6 don't work (goes in crash) in compiled mode :-(  in the ide mode, work without problem. Why????  :'(

Chris

  • Posts: 1810
Re:[vb6] ChannelSetSync crash
« Reply #1 on: 7 Jul '04 - 12:29 »
sorry but wihout seeing of any Code nobody can help you........
Greets Chris

Peter_Hebels

  • Posts: 119
Re:[vb6] ChannelSetSync crash
« Reply #2 on: 7 Jul '04 - 12:34 »
I've tested it and it did not crash on my pc, maybe a bug in your code? If you're not sure you can check if the 'Memory' project found in the 'VB' folder also crashes when you enable the Sync function.

Crazy_2000

  • Guest
Re:[vb6] ChannelSetSync crash
« Reply #3 on: 12 Jul '04 - 22:25 »

Public Sub StartSound()
    SYNCPROCEND = BASS_ChannelSetSync(StreamHandle, BASS_SYNC_END, EndPosition, AddressOf SyncEndFile, 0)
    Call BASS_StreamPlay(StreamHandle, 0, 0)
End Sub

Public Sub SyncEndFile(ByVal handle As Long, ByVal channel As Long, ByVal Data As Long, ByVal user As Long)
    Call StopSound
End Sub

Public Sub StopSound()
    Call BASS_ChannelRemoveSync(StreamHandle, SYNCPROCEND)
    Call BASS_ChannelStop(StreamHandle)
End Sub


Crazy_2000

  • Guest
Re:[vb6] ChannelSetSync crash
« Reply #4 on: 17 Jul '04 - 18:46 »
UP  :'(

Irrational86

  • Posts: 960
Re:[vb6] ChannelSetSync crash
« Reply #5 on: 17 Jul '04 - 20:42 »
when exactly does it crash? When executing the ChannelSetSync? The code does not seem to have any errors. It is very weird, but since VB is very picky on where it wants the libraries used by programs, make sure you don't have an older version of Bass laying around. Simply search for all "bass.dll" in all your harddrives and see where they are an what version...

Crazy_2000

  • Guest
Re:[vb6] ChannelSetSync crash
« Reply #6 on: 25 Jul '04 - 04:24 »
is the last version of bass.dll (2.0.0.22) my app it goes in crash! in vb ide, work perfectly.

I have lost the hopes...

Irrational86

  • Posts: 960
Re:[vb6] ChannelSetSync crash
« Reply #7 on: 25 Jul '04 - 21:33 »
Are you sure the program only crashes when using a sync? What if you remove the "BASS_ChannelSetSync" line of code only?

Crazy_2000

  • Guest
Re:[vb6] ChannelSetSync crash
« Reply #8 on: 26 Jul '04 - 15:49 »
if i don't use "ChannelSetSync" work all :-(
it is possible why I have used 2 "ChannelSetSync"

Thanks

Irrational86

  • Posts: 960
Re:[vb6] ChannelSetSync crash
« Reply #9 on: 26 Jul '04 - 21:10 »
There is no problem with using 2 ChannelSetSync...Just a guess, but try removing the "Public" in front of it

Crazy_2000

  • Guest
Re:[vb6] ChannelSetSync crash
« Reply #10 on: 28 Jul '04 - 00:25 »
don't work  :'(

thanks!!

Irrational86

  • Posts: 960
Re:[vb6] ChannelSetSync crash
« Reply #11 on: 28 Jul '04 - 04:34 »
Did you try the compiled EXE on another computer? Maybe with different OS?

sgdowney

  • Posts: 30
Re:[vb6] ChannelSetSync crash
« Reply #12 on: 28 Jul '04 - 15:21 »
Where is your SyncEndFile subroutine?  Is it in a Module (.bas) or Form (.frm).  All callback subroutines must be in modules in order for the AddressOf reference to work.

Crazy_2000

  • Guest
Re:[vb6] ChannelSetSync crash
« Reply #13 on: 1 Aug '04 - 01:41 »
module:

Public Sub SyncEndFile(ByVal handle As Long, ByVal channel As Long, ByVal Data As Long, ByVal user As Long)
    Call frmMain.StopSound (Public function)
End Sub

form:
Public Function StopSound()
      Call BASS_ChannelStop(StreamHandle)
End Function

Irrational86

  • Posts: 960
Re:[vb6] ChannelSetSync crash
« Reply #14 on: 1 Aug '04 - 04:22 »
Does it work?

Crazy_2000

  • Guest
Re:[vb6] ChannelSetSync crash
« Reply #15 on: 3 Aug '04 - 01:50 »
don't work  :'( :'( :'( :'(

Irrational86

  • Posts: 960
Re:[vb6] ChannelSetSync crash
« Reply #16 on: 3 Aug '04 - 03:33 »
Ok...just a guess...but do this...from inside the Callback, do something so that BASS_ChannelStop isnt called in there. Do you know how to create threads in VB? If so, make one that explicitly calls BASS_ChannelStop, and that should fix your problem.
« Last Edit: 3 Aug '04 - 03:33 by XMinioNX »

Crazy_2000

  • Guest
Re:[vb6] ChannelSetSync crash
« Reply #17 on: 6 Aug '04 - 05:40 »
Sorry, i don't understand  :'(

you can make a small example?

Thanks for your time!!!

Irrational86

  • Posts: 960
Re:[vb6] ChannelSetSync crash
« Reply #18 on: 7 Aug '04 - 15:43 »
Sorry, i don't understand  :'(

you can make a small example?

Thanks for your time!!!

Check this site out, it helps you on how to create a thread, Threads in Visual Basic (Article, With Example)

PS. Just reading on top of it, made me aware of the fact that it won't be a good idea to use a thread from inside VB. But check it out, in case you are still interested