How Is This Conversion An Error?

Discussion in 'Bug Reports' started by Louis, Nov 20, 2007.

  1. Louis

    Louis Active Member Licensed User

    Hi.
    In Basic4ppc when I pass one type from a library to another, different library I get an error from Basic4ppc that says the objects cannot be converted even though they are of the same type.
    E.G. When I made a dll to re-wrap the Channel class in Hekkus and made my New1 method accept a new Channel object that is passed by Speaker.Channel, when I pass it directly to my Channel wrapper Basic4ppc says the HssNET.Channel can't be converted to hssNET.Channel. Any suggestions? Making a Channel.value property to hold the object didn't help either. I need to do it this way because all methods in the Channel class are pure .NET Virtual calls and the New1 method in the original hssNET desktop/device can't be called from Basic4ppc and are NOT suppose to because of this.
    Thanks everyone.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You need to create a Value (the name isn't important) that returns the actual object.
     
  3. Louis

    Louis Active Member Licensed User

    Hi. In the hssNetdesktop/device.dll, the Speaker.Channel returns a new Channel object. When I pass the new object to my wrapped Channel class directly like this chl.New1 'Chl is a ChannelWrapper object
    c = speaker.PlaySound(Sound1.value)
    chl.value = speaker.Channel(c) 'This call returns a brand new Channel object, assigning it to chl.value
    Basic4ppc shows the Conversion error on the chl.value line. My wrapped object accepts Channel objects by value. I got a Visual Basic error when trying to do it by Reference. Thanks.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Can you post the code of ChannelWrapper ?
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice