The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: donkey on November 18, 2007, 05:02:57 PM

Title: IContextMenu problem
Post by: donkey on November 18, 2007, 05:02:57 PM
I've been struggling with creating a COM server for IContextMenu for the last couple of days and have hit an impasse. Explorer should call IShellExtInit:Initialize directly after the QueryInterface however it is not being called. Debugging this is very difficult since the error is generated inside explorer though the error is somewhere in my implementation of the interface. I have attached my source etc... if anyone has an idea why it's not working I would appreciate the input.

Note: GoAsm syntax

Title: Re: IContextMenu problem
Post by: donkey on November 18, 2007, 10:25:49 PM
Well, here's the final version of the IContextMenu example, I'll be testing it over the next few days then posting it on the website next weekend. Everything seems to work fine, it will do the following...

Register and unregister a Shell extension using DllRegisterServer/DllUnregisterServer
Create a class object
Create an instance of IShellExtInit and initialize the extension
Send Explorer a pointer to an instance of IContextMenu
Add to the context menu for EXE and DLL files
Extract the selected filename using the IDataObject interface and DragQueryFile
Display the filename

From this point you can do whatever you like with the file, I have simply displayed the name for the purpose of the demo.

The demo can be downloaded from the GoAsm section of the board.

Donkey