Author Topic: BASS_ChannelGetLevel is ambiguous because multiple kinds of members with this...  (Read 944 times)

-lukas-

  • Posts: 23
Hello,
I've used a few years old library bass files. I moved to the current version bass.dll, basenc.dll and Bass.Net.dll and appeared to me one mistake. In this declaration:

Code: [Select]
Imports Un4seen.Bass
Imports Un4seen.Bass.Misc
...
Dim lvl As Integer = Bass.BASS_ChannelGetLevel(strm)

Compiler reports this error - The error is earlier (several years old code) do not appear:
'BASS_ChannelGetLevel' is ambiguous because multiple kinds of members with this name exist in class 'Un4seen.Bass.Bass'.

(Using VB in VS 2010.)

I'm crazy with it...  ??? Can you help me please?

-lukas-

Guest

  • Guest
remove Imports Un4seen.Bass.Misc

-lukas-

  • Posts: 23
I deleted a row and nothing has changed - still the same error...  ???

Guest

  • Guest
i can not see the right imports by you so test this...
Imports Bass = Un4seen.Bass.Bass


kxth10

  • Posts: 29
VB6
Code: [Select]
ProgressBar1.value = LoWord(BASS_ChannelGetLevel(chan))         ' Left Level
ProgressBar2.value = HiWord(BASS_ChannelGetLevel(chan))          ' Right Level

VB2010
Code: [Select]
Dim Llvl As Integer = LoWord(Bass.BASS_ChannelGetLevel(strm))    ' Left Level
Dim Rlvl As Integer = HiWord(Bass.BASS_ChannelGetLevel(strm))    ' Right Level
« Last Edit: 6 Mar '16 - 16:06 by kxth10 »

Guest

  • Guest
ProgressBar1.value = LoWord(BASS_ChannelGetLevel(chan))         ' Left Level
ProgressBar2.value = HiWord(BASS_ChannelGetLevel(chan))          ' Right Level

has nothing to do with incorrect imports
if your want use BASS_ChannelGetLevel with Bass.BASS_ChannelGetLevel
then Change the Import is post before

-lukas-

  • Posts: 23
Thanks very much for your prompt reply.

To Guest: I added this line and the error still occurs  :(
Adding a line does not cause any new bug.

To kxth10: This is just another way of writing my code. Also not working.

Guest

  • Guest

-lukas-

  • Posts: 23
I did a test:
1) I started a completely new WinForms project in VS2010.
2) Using Project > Add Reference, I added a reference to Bass.net 2.4.11.1
3) The entire project code is this:

Code: [Select]
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim strm As Integer
        Dim lev As Integer = Un4seen.Bass.Bass.BASS_ChannelGetLevel(strm)

    End Sub
End Class

I still pop up the same error:
'BASS_ChannelGetLevel' is ambiguous because multiple kinds of members with this name exist in class 'Un4seen.Bass.Bass'.

What could be wrong?

Guest

  • Guest
Code: [Select]
Imports Bass = Un4seen.Bass.Bass

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Dim strm As Integer
        Dim lev As Integer = Bass.BASS_ChannelGetLevel(strm)

    End Sub
End Class

using Bass.net 2.4.11.1, Framework 4.5
no error with vs2012

-lukas-

  • Posts: 23
I have identical code, Framework 3.5 on VS2010 and I have an error :-(
On Framework 4 (max. for VS2010) is identical situation.

That would be a mistake in VS2010? Or in old Framework?

Thank you for your time.

radio42

  • Posts: 4574
Please try this version - it looks like a VB.Net overload restriction; which is now fixed in the attached version...

-lukas-

  • Posts: 23
Thank you very much for the quick response! After rewriting the library error has disappeared! :-)

But when I started compiling, I discovered this issue:

The primary reference "Bass.Net, Version=2.4.11.2, Culture=neutral, PublicKeyToken=b7566c273e6ef480, processorArchitecture=MSIL" could not be resolved because it was built against the ".NETFramework,Version=v4.0" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v2.0".

Is there any way to run a new library in Framework 2.0?
« Last Edit: 6 Mar '16 - 21:47 by -lukas- »

radio42

  • Posts: 4574
No, then you would need another build - as each .Net assembly is build against a certain minimum version.
But why are you still targeting a completely outdated .Net Framework?
Isn't there a chance for you to also build your application against the .Net Framework v4.x?

Guest

  • Guest
confus

Quote
Please try this version - it looks like a VB.Net overload restriction; which is now fixed in the attached version...
why then i have not the same error?
i think is a Framework Trouble.. or?


-lukas-

  • Posts: 23
To radio42: My applications often run on older machines with Windows XP. I would not like forcing users to install FW 4.0, unless it is necessary.
On your website you write: "works with the Microsoft .NET Framework v2.0, v3.0, v3.5 and v4.0 / 4.5"
If the library does not support the version 2, so I'll have to adjust. If you made a compilation for version 2.0, I'd be very happy.

To Guest: The difference between you and me is that you have Framework 4, and I Framework 2. I also do not understand why it's a problem :o radio42 will probably know more about the differences in compatibility between frameworks.
« Last Edit: 7 Mar '16 - 11:16 by -lukas- »

Guest

  • Guest
Quote
The difference between you and me is that you have Framework 4, and I Framework 2.
that is clear

i'm confus
why then Change the lib is working by me with the right Framework..
that is my question ;)

radio42

  • Posts: 4574
The lib does support all mentioned versions - but I have just build this hotfix for v4.0 only!
As I simply do NOT build a hotfix for all available version (like Windows CE, Android, Linux, OSX, iOS etc.)
That's it ;-)

Ian is just about to release a new version as well - which I am waiting for...
As such the next official version will of course contain that fix for all available versions...

-lukas-

  • Posts: 23
This is great news!  :)
Thank you very much for 4.0 hotfix - I'm glad you sent him so quickly.

How long do you estimate about the new release? Day, week, month, year ...  ;)

radio42

  • Posts: 4574
I guess it will be within the next days... ;-)