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 get running instance

how to get running instance

Scheduled Pinned Locked Moved COM
tutorialquestion
6 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.
  • P Offline
    P Offline
    prasad_som
    wrote on last edited by
    #1

    CComObject::CreateInstance method creates new instance of CComObject. Instead I want to access running instance of class, if there is any. Is it possible? -- modified at 5:48 Tuesday 28th March, 2006

    L L 2 Replies Last reply
    0
    • P prasad_som

      CComObject::CreateInstance method creates new instance of CComObject. Instead I want to access running instance of class, if there is any. Is it possible? -- modified at 5:48 Tuesday 28th March, 2006

      L Offline
      L Offline
      Laxman Auti
      wrote on last edited by
      #2

      Try to use QueryInterface to that class Knock out "T" from CAN'T You 'CAN' if you think you 'CAN' :cool:

      P 1 Reply Last reply
      0
      • L Laxman Auti

        Try to use QueryInterface to that class Knock out "T" from CAN'T You 'CAN' if you think you 'CAN' :cool:

        P Offline
        P Offline
        prasad_som
        wrote on last edited by
        #3

        Y, it is one way. But I want to get instance of coclass. ie.

        CComObject::CreateInstance

        creates new instance . Instead I want running instance if there is already one . May be this is not possible -- modified at 23:23 Wednesday 29th March, 2006

        M 1 Reply Last reply
        0
        • P prasad_som

          Y, it is one way. But I want to get instance of coclass. ie.

          CComObject::CreateInstance

          creates new instance . Instead I want running instance if there is already one . May be this is not possible -- modified at 23:23 Wednesday 29th March, 2006

          M Offline
          M Offline
          Milton Karimbekallil
          wrote on last edited by
          #4

          go thru http://www.codeproject.com/atl/cpmonikers.asp[^] cheers mil10.

          P 1 Reply Last reply
          0
          • P prasad_som

            CComObject::CreateInstance method creates new instance of CComObject. Instead I want to access running instance of class, if there is any. Is it possible? -- modified at 5:48 Tuesday 28th March, 2006

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            May be Running Object Table (ROT) will help you. Check MSDN for further details of its usage.* * *

            Have a great day ahead! Regards, Sohail Kadiwala (My Blog - http://blogs.wdevs.com/sohail/[^])

            1 Reply Last reply
            0
            • M Milton Karimbekallil

              go thru http://www.codeproject.com/atl/cpmonikers.asp[^] cheers mil10.

              P Offline
              P Offline
              prasad_som
              wrote on last edited by
              #6

              Let me be reword my problem. In ATL , class CComObject has a static method CreateInstance which gives A pointer to a CComObject<Base> pointer In similar way , is it possible to get pointer to a running CComObject<Base> ? I'm pasting snippet from MSDN to make it more clear.

              // Create a local instance of COM object CMyCircle.
              double x;
              CComObject<CMyCircle>* pCircle;
              HRESULT hRes = CComObject<CMyCircle>::CreateInstance(&pCircle);// is there any method to get running instance instead of new one.
              _ASSERTE(SUCCEEDED(hRes));

              -- modified at 4:33 Friday 31st March, 2006

              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