23 May '13 - 11:33 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: An incorrect Version of Bass was loaded 2.3. instead of 2.4.  (Read 784 times)
shine47
Posts: 7


« on: 3 Jun '12 - 17:27 »
Reply with quoteQuote

Hi!

We use bass.dll 24.7.1 with NET. It is in the folder of the excutable in Libs\x86. On all machines everything works fine. The libraries are loaded
like this: 

Bass.LoadMe(System.Windows.Forms.Application.StartupPath + "\\Libs\\x86\\"...

But on one persons machine (Also Windows 7) this error occures:

"An incorrect Version of Bass was loaded 2.3. instead of 2.4."

How can that happen because the folder from which to load the libs is named explicitly? I tried several things but was not able to provoke the errror on my system.


Thank you for hint!
Logged
radio42
Posts: 4012


« Reply #1 on: 4 Jun '12 - 08:52 »
Reply with quoteQuote

Hoiw did you compile your App?
For 'Any CPU' or explicitly for 'x86' target?
Could it be, that any other component already loaded a different BASS version from any other location?
Logged
shine47
Posts: 7


« Reply #2 on: 4 Jun '12 - 12:06 »
Reply with quoteQuote

We compiled it explicitly for 'x86 '. No other component from our application loads Bass, i tested it by using the tool Process Explorer. Is there a possibility that another application on the system,
where the error occurs, loaded the old bass version and ours is trying to use this one?
Logged
Ian @ un4seen
Administrator
Posts: 15269


« Reply #3 on: 4 Jun '12 - 16:42 »
Reply with quoteQuote

Another app won't affect which BASS version is loaded by your app, so long as your app is using a BASS.DLL that is local to it, eg. not in a system folder (which might be overwritten by another app). Perhaps the problem is the "System.Windows.Forms.Application.StartupPath" reference? To confirm whether it is giving the correct path, you could try logging (or display a dialog) the contents of that prior to making the "LoadMe" call.
Logged
shine47
Posts: 7


« Reply #4 on: 6 Jun '12 - 08:13 »
Reply with quoteQuote

It uses the right path to the Libs/x86-Folder.
Logged
Emil Weiss
Posts: 107


« Reply #5 on: 6 Jun '12 - 08:26 »
Reply with quoteQuote

It uses the right path to the Libs/x86-Folder.

and you are sure that no further bass.dll exists in the system path of the user?

greets
Logged
shine47
Posts: 7


« Reply #6 on: 6 Jun '12 - 08:43 »
Reply with quoteQuote

I am not sure, but tested it on my machine. It loaded correctly from the Libs-Folder, alternatively from the Exe-Folder, but not from the System-Folder (i copied Bass there). Maybe it is also unlikely
that the user has Bass in the system-folder because the Bass.dlls are not installed (i think). I will check that out.
Logged
Emil Weiss
Posts: 107


« Reply #7 on: 6 Jun '12 - 09:40 »
Reply with quoteQuote

I am not sure, but tested it on my machine. It loaded correctly from the Libs-Folder, alternatively from the Exe-Folder, but not from the System-Folder (i copied Bass there). Maybe it is also unlikely
that the user has Bass in the system-folder because the Bass.dlls are not installed (i think). I will check that out.

you can change the path as your want ..
Sample!

        BassPath = "%Path%;" & Application.StartupPath & "\BassLib"
        Win32Api.SetEnvironmentVariable("Path", BassPath)

that always works for me

greets
Logged
shine47
Posts: 7


« Reply #8 on: 7 Jun '12 - 14:53 »
Reply with quoteQuote

thanks for the sample! i think i will copy the bass-dlls to the folder of the exe-file, because it comes first in the search order,
even before the system-folder. i load them like: "Bass.LoadMe()".
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines