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. COM
  4. How to using the second IDispatch of a COM object in VBScript

How to using the second IDispatch of a COM object in VBScript

Scheduled Pinned Locked Moved COM
questionc++comdesigntutorial
4 Posts 4 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.
  • B Offline
    B Offline
    bojinyu
    wrote on last edited by
    #1

    I design a COM object by ATL, which has two IDispath. Default dispatch is IPlot2D, and the second is IMIDraw. IMIDraw has a method Plot(), how do I launch Plot() method?

    V R 2 Replies Last reply
    0
    • B bojinyu

      I design a COM object by ATL, which has two IDispath. Default dispatch is IPlot2D, and the second is IMIDraw. IMIDraw has a method Plot(), how do I launch Plot() method?

      V Offline
      V Offline
      Vi2
      wrote on last edited by
      #2

      Define some method of default IPlot2D interface which will return the IMIDraw interface. In idl: [propget] HRESULT DrawManager([out,retval]IMIDraw ** ppDraw) In C++: STDMETHODIMP HRESULT CPlot2D::DrawManager(/*[out,retval]*/IMIDraw ** ppDraw) { return QueryInterface(IID_IMIDraw,(void**)ppDraw); } In VB: Dim o As Plot2D, o2 As IMIDraw Set o = CreateObject("PlotLib.Plot2D") ' or = New Plot2D Set o2 = o.**DrawManager** o2.**Plot** ' Or o.**DrawManager.Plot** In VBScript: Dim o, o2 Set o = CreateObject("PlotLib.Plot2D") Set o2 = o.**DrawManager** o2.**Plot** ' Or o.**DrawManager.Plot** With best wishes, Vita

      J 1 Reply Last reply
      0
      • B bojinyu

        I design a COM object by ATL, which has two IDispath. Default dispatch is IPlot2D, and the second is IMIDraw. IMIDraw has a method Plot(), how do I launch Plot() method?

        R Offline
        R Offline
        Renjith Ramachandran
        wrote on last edited by
        #3

        QueryInterface Code the Dreams~

        1 Reply Last reply
        0
        • V Vi2

          Define some method of default IPlot2D interface which will return the IMIDraw interface. In idl: [propget] HRESULT DrawManager([out,retval]IMIDraw ** ppDraw) In C++: STDMETHODIMP HRESULT CPlot2D::DrawManager(/*[out,retval]*/IMIDraw ** ppDraw) { return QueryInterface(IID_IMIDraw,(void**)ppDraw); } In VB: Dim o As Plot2D, o2 As IMIDraw Set o = CreateObject("PlotLib.Plot2D") ' or = New Plot2D Set o2 = o.**DrawManager** o2.**Plot** ' Or o.**DrawManager.Plot** In VBScript: Dim o, o2 Set o = CreateObject("PlotLib.Plot2D") Set o2 = o.**DrawManager** o2.**Plot** ' Or o.**DrawManager.Plot** With best wishes, Vita

          J Offline
          J Offline
          Jorgen Sigvardsson
          wrote on last edited by
          #4

          You can't have 2 IDispatch interface on one COM object. -- Only in a world this shitty could you even try to say these were innocent people and keep a straight face.

          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