Problem with "ActivationContext" and multithreading
-
I have an application(MFC), which should work with some "registration-free" com-components. I have extended the the application manifest and created a "com-manifest", as shown in the ms-examples. Everything works fine. BUT, one of my menuitems starts a userthread which needs one of the "registration-free" com-components, an ocx. The creation of the component succeeeds, but the QuickActivate() fails with an access violation. Some ideas what goes wrong? :sigh: Hoping for help, thank you.
-
I have an application(MFC), which should work with some "registration-free" com-components. I have extended the the application manifest and created a "com-manifest", as shown in the ms-examples. Everything works fine. BUT, one of my menuitems starts a userthread which needs one of the "registration-free" com-components, an ocx. The creation of the component succeeeds, but the QuickActivate() fails with an access violation. Some ideas what goes wrong? :sigh: Hoping for help, thank you.
Jürgen Jung wrote:
I have an application(MFC), which should work with some "registration-free" com-components. I have extended the the application manifest and created a "com-manifest", as shown in the ms-examples. Everything works fine. BUT, one of my menuitems starts a userthread which needs one of the "registration-free" com-components, an ocx. The creation of the component succeeeds, but the QuickActivate() fails with an access violation. Some ideas what goes wrong? Hoping for help, thank you.
A .ocx file sounds like an ActiveX control dll, and ActiveX controls can only run in the user interface thread. It seems likely that whatever object you need to access would need special thread safety additions. If the component you need is itself an ActiveX control, then your problem is more difficuld. You can either find some way to get the control accessed from the UI thread, or you could factor out whatever you need access to into a thread safe component. Nathan