Results 1 to 5 of 5

Thread: Inheritance and References

  1. #1

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    Inheritance and References

    Hmm I just noticed something I thought was strange, I have a base class in Edneeis.Utilities.dll and I use this base class in Tracker.Framework.dll which is used in ObjectTester.dll. ObjectTester only has a reference to Tracker.Framework.dll and this gives me an error when any base class methods are called that originate in Edneeis.Utilities.dll because it isn't directly referenced in ObjectTester. Has that confusing enough? Is this correct does a project have to reference all base classes/dependent classes of the objects it uses? Or did I miss something?

    As a recap in my ObjectTester app I use a Nurse object (from Tracker.Framework.dll) which inherits from the DataLayer object (from Edneeis.Utilities.dll). ObjectTester has a reference to Tracker.Framework but not Edneeis.Utilities and this gives an error.

  2. #2

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Stranger still it only happens when I use a method/event/whatever that is only directly related to the base class object. For instance the child class has a Save method with no parameters that calls the Save method in the base class and passes parameters to it. This doesn't have a problem, unless I call the parameterized version that is in the base class directly. The same with events, if the event is declared in the base class only then I can't use it without a reference to the base class assembly, but if I redeclare it and call the base event from the child object then I don't need the reference.

    It must be some sort of casting issue.

  3. #3
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    any possibility it thinks you are trying to use multiple inheritance?

  4. #4
    Addicted Member PeteD's Avatar
    Join Date
    Jun 2003
    Location
    Sydney
    Posts
    158
    When you add a reference to a dll, you should get a copy of of it, and all of its dependancy dlls in your project's bin directory.

  5. #5

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I just ended up making a reference to it. It seemed to be the only way to fix the problem. The dll was in the application directory but not referenced and it still didn't like it. The trouble began when I switched from referencing the Project to the actual DLL.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width