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. Visual Basic
  4. query interface in VB??.....

query interface in VB??.....

Scheduled Pinned Locked Moved Visual Basic
c++databasecomquestion
3 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.
  • K Offline
    K Offline
    kunja_chan
    wrote on last edited by
    #1

    Guyz, I remember working with C++ COM, I could use QueryInterface to find whether an interface is supported in a component. Is there a similar mechanism in VB too? If not what would be a best way to do. :eek:Thnx!

    B 1 Reply Last reply
    0
    • K kunja_chan

      Guyz, I remember working with C++ COM, I could use QueryInterface to find whether an interface is supported in a component. Is there a similar mechanism in VB too? If not what would be a best way to do. :eek:Thnx!

      B Offline
      B Offline
      beowulfagate
      wrote on last edited by
      #2

      You could use the "IF TYPEOF objectname IS objecttype" statement in VB.NET to determine if a component supports a given interface.

      T 1 Reply Last reply
      0
      • B beowulfagate

        You could use the "IF TYPEOF objectname IS objecttype" statement in VB.NET to determine if a component supports a given interface.

        T Offline
        T Offline
        The Man from U N C L E
        wrote on last edited by
        #3

        A better method (object orientated etc.) would be to use IsInstanceOf e.g. to find out if MyObject implements the interface IMyInterface use the following code.

        GetType(IMyInterface).IsInstanceOfType(MyObject)
        
        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