Dynamic Bass

Started by DanaPaul, 22 May '03 - 10:38

DanaPaul

My understanding of FreeLibrary (dynamic binding) is that the Operating System will physically unload the module sometime, later, when it feels like it, and/or when the O/S needs to free usable memory space.

Regarding single instance Bass exclusively and a 640 MB RAM system...

The problem that I'm having with BassCD and BassWMA is that if I use BassCD to populate a list box with available CD drives in my OnShow form event, unload BassCD and Bass, and then load Bass and BassWMA and try to do anything with BassWMA it (BassWMA) will just sit there.  No error conditions returned trying to create a stream!

If I remove all usage of BassCD the BassWMA module will behave as expected.

Am I missing something, or is this the way that it has to be?

fredvs

Hi

I have the same problem. For example , even with your bass header, it is impossible to copy bass.dll in bass2.dll cause in your "uses" you have to put bass.pas and bass2.pas, and at the "form create", it look at bass2.dll before that i have copy it. That meen that bass2.dll must be loaded before bass init (or your loaddll), then i got a error message, "bass2.dll is missing", and i dont have find a way to copy it before, must i have to write 2 apps, the first who dont use bass and who will copy bass.dll in bass2.dll, close it and then load the app who use bass.dll ?

DanaPaul


These are multiple instance questions that are addressed in the multiple instance header file.

Quoteat the "form create", it look at bass2.dll before that i have copy it.
FileCopy(bass.dll, bass2.dll);
LoadBassDll
LoadBass2Dll
QuoteThat meen that bass2.dll must be loaded before bass init (or your loaddll),
Yes.
Quotethen i got a error message, "bass2.dll is missing", and i dont have find a way to copy it before, must i have to write 2 apps, the first who dont use bass and who will copy bass.dll in bass2.dll, close it and then load the app who use bass.dll ?
No.

fredvs

#3
Hi
I if i do, a the first line of form.create :

QuoteFileCopy(bass.dll, bass2.dll);
LoadBassDll;
LoadBass2Dll;

It does not work : "Missing bass2.dll" and bass2.dll was NOT copy. Even if i do, for a single bass :

QuoteFileCopy(c:\temp\bass.dll, bass.dll);
LoadBassDll;

I receive "Missing bass.dll and bass.dll was not copied.

DanaPaul

Fred,

Support for multiple Bass instances using the single instance header file is tempting, but time consuming considering the fact that the multiple instance header file fully supports multiple instances.

QuoteIt does not work : "Missing bass2.dll" and bass2.dll was NOT copy.

The Delphi help files have a wealth of information regarding files, copy and delete.  Look for "ExpandFileName" :)

fredvs

Hi
QuoteLook for "ExpandFileName"

Thanks but i know that.

Have you try, with a simple instance ?
QuoteFileCopy(c:\temp\bass.dll, bass.dll);
LoadBassDll;

It does not work because delphi look at bass.dll before to copy it.

DanaPaul


QuoteIt does not work because delphi look at bass.dll before to copy it.

Ahhhh, now we get into hardware :)

You probably have "Write behind Cache" enabled in your Operating System options.  Yes, I have tried the header files many times, my fingers are down to stubs  ;)

Try this...

FileCopy(Blah, Blah2)
Sleep(50)
LoadBassDll

Ian @ un4seen

QuoteThe problem that I'm having with BassCD and BassWMA is that if I use BassCD to populate a list box with available CD drives in my OnShow form event, unload BassCD and Bass, and then load Bass and BassWMA and try to do anything with BassWMA it (BassWMA) will just sit there.  No error conditions returned trying to create a stream!
I'm not sure what you mean by "just sit there". Do you mean a call to BASS_WMA_StreamCreateFile never returns?

But, why are you unloading BASS, if you're then going to reload it? :)

DanaPaul


QuoteI'm not sure what you mean by "just sit there". Do you mean a call to BASS_WMA_StreamCreateFile never returns?

The call returns, but without a stream and without any error.

QuoteBut, why are you unloading BASS, if you're then going to reload it? :)
Ummmm, it is reloading in response to a user event.  I'll check to see if this makes a difference, BRB :)

DanaPaul

QQps,

Ummm, all fixed.  I had (one) more calls to load BassCD than Unload.  BassCD and BassWMA do get along. Thanks :)

fredvs

Hi DP  :-*

QuoteSleep(50)

 :P Whouaw...

Too much, you are too much, how is it possible to be so intelligent.

Of course it works perfectly now and i finally have understand why my pc refused to copy this bass2.dll.

Thanks a lot.  :-*

Quick Reply

Warning: this topic has not been posted in for at least 365 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name:
Email:
Verification:
Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
Shortcuts: ALT+S post or ALT+P preview