PDA

View Full Version : ActiveQt not calling COM functions



daveg
18th May 2011, 00:47
Hi,
So I've implemented a shell extension COM object that has a QAxBindable object that creates a QAxAggregated object. It implements IShellExtInit and IContextMenu. I register the extension as a ContextMenuHandler for all files and it works fine on the Desktop. I can see the IShellExtInit and IContextMenu interfaces get queried and see their member functions invoked. However, in the actual Explorer windows it gets loaded and the QAxBindable interface is called to instantiate the QAxAggregated, but then the Initialize member function of IShellExtInit never actually gets invoked like it does when I right click on the desktop. I suppose this is an issue with COM but I have been unable to find a cause for the problem.

Further, when i set the ThreadingModel in the registry to Apartment, then the context menu will load in whatever window it's first loaded in, but then not at all in any others.

Any thoughts? I can provide more information, just wondered if anyone had seen anything like this before.

Tilda
31st May 2011, 17:58
Hello,
As a coincidence, I'm also trying to create a context menu shell extension :) I based the code on what I did for overlay icons (http://www.qtcentre.org/threads/32104-howto-making-a-windows-shell-extension-with-qt-open-source-edition) but explorer never shows my menu.
On the other hand, when I'm opening a file dialog (e.g. "open file dialog" from notepad), I always see my context menu, but never in explorer!

After adding "ThreadingModel" to my registry, I still did not observe the menu even once in explorer :(
After the first time it displays on your machine, is your "ThreadingModel" value kept in the registry or removed?

daveg
13th June 2011, 05:41
Hello, I managed to get the context menu to display everywhere by removing the code within activeqt that checks to make sure the same thread id is invoking the call. It seems to work although it does crash from the constructor of a QLocalSocket but only if it's called for a context menu in a different thread. I'm not sure exactly where to proceed from here.

anpe
11th October 2011, 09:45
Hi,

I have faced this same problem, as my context menu shows when right clicking files from desktop or from notepad open file dialog but not in actual file explorer. Has someone found solution for this?