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. GIT and the FTM

GIT and the FTM

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

    When I call IGlobalInterfaceTable::RevokeInterfaceFromGlobal from a FTM object created in the main STA for an sub-object that was created from a MTA thread, a deadlock seems to occurs while I am revoking the interface (from the STA). Here are the steps: 1) Create an object (that aggregate the FTM) in the main STA 2) Call a function on that object from a MTA thread and from that function create an sub-object (that does uses the FTM) in the STA but register it in the GIT from the MTA. 3) Destroy the object from the STA. When revoking the cookie for the sub-object a deadlock seems to occurs. Any idea for a solution? Should an object always be registered from it own apartment? Does there is some restrictions when using the GIT for FTM objects? Is my problem caused by the MTA not responding at that time? In fact, if I force the creation of the sub-object from the STA instead of waiting when I need it (which will occurs from a call made from a MTA in my case), no deadlock will occurs... I haven't found much "advanced" informations on the GIT and the MSDN documentation is not clear enough about potential problems, limitations and restrictions. Any suggestions? Philippe Mori

    S P 2 Replies Last reply
    0
    • P Philippe Mori

      When I call IGlobalInterfaceTable::RevokeInterfaceFromGlobal from a FTM object created in the main STA for an sub-object that was created from a MTA thread, a deadlock seems to occurs while I am revoking the interface (from the STA). Here are the steps: 1) Create an object (that aggregate the FTM) in the main STA 2) Call a function on that object from a MTA thread and from that function create an sub-object (that does uses the FTM) in the STA but register it in the GIT from the MTA. 3) Destroy the object from the STA. When revoking the cookie for the sub-object a deadlock seems to occurs. Any idea for a solution? Should an object always be registered from it own apartment? Does there is some restrictions when using the GIT for FTM objects? Is my problem caused by the MTA not responding at that time? In fact, if I force the creation of the sub-object from the STA instead of waiting when I need it (which will occurs from a call made from a MTA in my case), no deadlock will occurs... I haven't found much "advanced" informations on the GIT and the MSDN documentation is not clear enough about potential problems, limitations and restrictions. Any suggestions? Philippe Mori

      S Offline
      S Offline
      soptest
      wrote on last edited by
      #2

      May be this will help you to resolve this problem: The apartment that calls RegisterInterfaceInGlobal method must remain alive until the corresponding call to RevokeInterfaceFromGlobal. soptest

      1 Reply Last reply
      0
      • P Philippe Mori

        When I call IGlobalInterfaceTable::RevokeInterfaceFromGlobal from a FTM object created in the main STA for an sub-object that was created from a MTA thread, a deadlock seems to occurs while I am revoking the interface (from the STA). Here are the steps: 1) Create an object (that aggregate the FTM) in the main STA 2) Call a function on that object from a MTA thread and from that function create an sub-object (that does uses the FTM) in the STA but register it in the GIT from the MTA. 3) Destroy the object from the STA. When revoking the cookie for the sub-object a deadlock seems to occurs. Any idea for a solution? Should an object always be registered from it own apartment? Does there is some restrictions when using the GIT for FTM objects? Is my problem caused by the MTA not responding at that time? In fact, if I force the creation of the sub-object from the STA instead of waiting when I need it (which will occurs from a call made from a MTA in my case), no deadlock will occurs... I haven't found much "advanced" informations on the GIT and the MSDN documentation is not clear enough about potential problems, limitations and restrictions. Any suggestions? Philippe Mori

        P Offline
        P Offline
        Philippe Mori
        wrote on last edited by
        #3

        I have change how objects are destroyed and it seems to works fine... Now I start by destroying sub-object in FinalRelease and then releasing the FTM for that object. In my initial implementation (which was not working in some cases), the FTM was destroyed first (in FinalRelease) but sub-objects were destroyed only by the destructor (automatic objects are used). Also I now aggregate the FTM on demand for each of those object. Philippe Mori

        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