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. Referencing Interfaces

Referencing Interfaces

Scheduled Pinned Locked Moved C#
question
4 Posts 3 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.
  • W Offline
    W Offline
    work_to_live
    wrote on last edited by
    #1

    I have three projects... 1) An interface definition dll as Project1. 2) An object definition dll as Project2. 3) A test application as Project3. Class1 in Project2 implements the interface defined in Project1. The test application uses Class1. For some reason, I have to add a reference to the interface dll in both Project2 and Project3! I thought it would only be necessary to reference the interface in Project2, and that it would not be necessary to reference the interface in the application that uses Class1 in Project3. Is this the expected behaviour?

    J G 2 Replies Last reply
    0
    • W work_to_live

      I have three projects... 1) An interface definition dll as Project1. 2) An object definition dll as Project2. 3) A test application as Project3. Class1 in Project2 implements the interface defined in Project1. The test application uses Class1. For some reason, I have to add a reference to the interface dll in both Project2 and Project3! I thought it would only be necessary to reference the interface in Project2, and that it would not be necessary to reference the interface in the application that uses Class1 in Project3. Is this the expected behaviour?

      J Offline
      J Offline
      Jun Du
      wrote on last edited by
      #2

      Have you declared an interface pointer in Project3 code?

      Best, Jun

      W 1 Reply Last reply
      0
      • W work_to_live

        I have three projects... 1) An interface definition dll as Project1. 2) An object definition dll as Project2. 3) A test application as Project3. Class1 in Project2 implements the interface defined in Project1. The test application uses Class1. For some reason, I have to add a reference to the interface dll in both Project2 and Project3! I thought it would only be necessary to reference the interface in Project2, and that it would not be necessary to reference the interface in the application that uses Class1 in Project3. Is this the expected behaviour?

        G Offline
        G Offline
        Guffa
        wrote on last edited by
        #3

        Search the boards. I remember that the exact same question was asked not long ago.

        --- b { font-weight: normal; }

        1 Reply Last reply
        0
        • J Jun Du

          Have you declared an interface pointer in Project3 code?

          Best, Jun

          W Offline
          W Offline
          work_to_live
          wrote on last edited by
          #4

          No... Project3 creates an instance of Class1.

          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