Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. simple override and virtual question

simple override and virtual question

Scheduled Pinned Locked Moved C#
comquestioncsharpc++winforms
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    donovan solms
    wrote on last edited by
    #1

    hi, i'm not sure anymore, i've confused myself. i have this in a com-visible dll: public class Interop : ITouchlibInterop { public virtual void fingerDown() { //some code here that handles the 'event' } } now in another file, my interface (winforms); class Touch : Interop { public override void fingerDown() { //some new code that handles it } } the first class (Interop : ITouchlibInterop) is called from a c++ dll via COM. then i want my derived class - that is my interface handle the 'event' and not the com-visible dll. now for my question: will Touch.fingerDown() be called when Interop.fingerDown() is called?

    rather have something you don't need, than need something you don't have

    L 1 Reply Last reply
    0
    • D donovan solms

      hi, i'm not sure anymore, i've confused myself. i have this in a com-visible dll: public class Interop : ITouchlibInterop { public virtual void fingerDown() { //some code here that handles the 'event' } } now in another file, my interface (winforms); class Touch : Interop { public override void fingerDown() { //some new code that handles it } } the first class (Interop : ITouchlibInterop) is called from a c++ dll via COM. then i want my derived class - that is my interface handle the 'event' and not the com-visible dll. now for my question: will Touch.fingerDown() be called when Interop.fingerDown() is called?

      rather have something you don't need, than need something you don't have

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi,

      Interop a=new Touch();
      a.fingerDown();

      will call Touch.fingerDown() although a is declared only as an Interop object. BTW you should start public methods with an uppercase letter. :)

      Luc Pattyn [My Articles]

      D 1 Reply Last reply
      0
      • L Luc Pattyn

        Hi,

        Interop a=new Touch();
        a.fingerDown();

        will call Touch.fingerDown() although a is declared only as an Interop object. BTW you should start public methods with an uppercase letter. :)

        Luc Pattyn [My Articles]

        D Offline
        D Offline
        donovan solms
        wrote on last edited by
        #3

        thanks again for you help

        rather have something you don't need, than need something you don't have

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups