Results 1 to 2 of 2

Thread: Problem passing derived objects

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2003
    Posts
    23

    Problem passing derived objects

    I tried asking this in the VB.Net forum, but didn't get any responses there, so I thought I'd try this topic instead. I'm trying to drag objects from one form to another. I have the mechanics of it working fine, but I want to do something a little different. I have a class called ManagedObject. I also have several classes derived from that class, such as a class called SystemData. Now, what I would like to be able to do is pass one of these derived objects in a dragdrop operation, and have the target form accept any object that is derived from ManagedObject. Right now I have to specify the specific object type in the Drag_Enter event for it to properly recognize the object type. Is it possible to get it to accept any object that derives from ManagedObject?

  2. #2
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Re: Problem passing derived objects

    I can't think of a problem passing an object that derives from a base class and declaring that base class as a parameter. Do you have some code that you can post so I can play a bit with this?
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

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