2018. 11. 9. 16:00

Using Global Interface Table(GIT) for marshalling COM interfaces

Dr. Dobb's artible


There are several things to consider when you implement codes. Recently, I implemented a program and I used GIT for marshalling COM interfaces. There is no problem when the RegisterInterfaceInGlobal function is called, but it is failed to call GetInterfaceFromGlobal. Sometimes, it causes a hang or returns errors.


I found reasons.

  1. The thread which calls the RegisterInterfaceInGlobal method must remain alive until the corresponding call to RevokeInterfaceFromGlobal.
  2. The thread which uses GIT must have a message loop to handle calls of GIT
    • Single-Threaded Apartments
    • The MsgWaitForMultipleObjects method is a proper choice when you have to use synchronization primitives.