Processing
 

Icon Handler Shell Extension not called

29/08/2016 14:51#1

rrirower

Member

Joined at: 4 months ago

Post: 2

Thank: 0

Thanked: 0

I used VS2015 and the ATL project wizard to write a Shell Extension Icon handler. I created a COM object to expose the IPersist and IExtractIcon interfaces. I can see that the handler is registered when I look at the registry entry for the specific file type. Here’s what the class looks like:

class ATL_NO_VTABLE CIconHandlerExt :     public CComObjectRootEx<CComSingleThreadModel>,     public CComCoClass<CIconHandlerExt, &CLSID_IconHandlerExt>,     public IIconHandlerExt,     public IPersistFile,     public IExtractIcon { public:     CIconHandlerExt()     {     }      DECLARE_PROTECT_FINAL_CONSTRUCT()      HRESULT FinalConstruct()     {         return S_OK;     }      void FinalRelease()     {     }  DECLARE_REGISTRY_RESOURCEID(IDR_ICONHANDLEREXT)  DECLARE_NOT_AGGREGATABLE(CIconHandlerExt)  BEGIN_COM_MAP(CIconHandlerExt)     COM_INTERFACE_ENTRY(IIconHandlerExt)     COM_INTERFACE_ENTRY(IPersistFile)     COM_INTERFACE_ENTRY(IExtractIcon) END_COM_MAP()  // IIconHandlerExt public:      // IExtractIcon     STDMETHODIMP GetIconLocation(UINT uFlags, LPTSTR szIconFile, UINT cchMax, int* piIndex, UINT* pwFlags);     STDMETHODIMP Extract(LPCTSTR pszFile, UINT nIconIndex, HICON* phiconLarge, HICON* phiconSmall, UINT nIconSize);  public:     // IPersistFile     //xxxSTDMETHOD(GetClassID)(CLSID*) { return E_NOTIMPL; }     STDMETHOD(GetClassID)(CLSID *pClsId) { *pClsId = CLSID_IconHandlerExt;  return S_OK; }     STDMETHOD(IsDirty)() { return E_NOTIMPL; }     STDMETHOD(Save)(LPCOLESTR, BOOL) { return E_NOTIMPL; }     STDMETHOD(SaveCompleted)(LPCOLESTR) { return E_NOTIMPL; }     STDMETHOD(GetCurFile)(LPOLESTR*) { return E_NOTIMPL; }     STDMETHOD(Load)(LPCOLESTR wszFile, DWORD /*dwMode*/)     {         USES_CONVERSION;         lstrcpyn(m_szFilename, OLE2CT(wszFile), MAX_PATH);         return S_OK;     }  protected:     TCHAR     m_szFilename[MAX_PATH];  // Full path to the file in question.  };  OBJECT_ENTRY_AUTO(__uuidof(IconHandlerExt), CIconHandlerExt) 

I used the instructions in this post to start the debugging session. Namely, I click the task bar, hit Alt-F4, Press Ctrl-Alt-Shift-Escape, and start my debugger session that specifies Windows Explorer as the command target. I set breakpoints and navigate to the test file.

My handler is never loaded since the breakpoints are not hit and they say

“The breakpoint will not currently be hit. No symbols have been loaded for this document.”

Can anyone shed light on why my extension does not load?

30/08/2016 19:02Top#2

rrirower

Member

Joined at: 4 months ago

Post: 2

Thank: 0

Thanked: 0

This question has been solved.

The Shell Extension requires making an update to the wizard generated registry script to identify the handler that should be used for the particular file type. I did not pay attention to the key I was updating (from within the registry script) and updated the wrong key. In my case, the file type I was trying to add a handler for was “mcam”. So, I updated the “HKCR.mcam” key. This is incorrect because the purpose of this initial key is to point (via a “mcamFile” sub-key) to the actual registry key that determines what handler to load. Once I changed the script to update the “HKCR\mcamFile” key, the handler was loaded and I was able to debug my code.

Similar articles

Window Registry create key not working in java

4 months ago - Reply: 1 - Views: 74

Metro App crash on Windows 10

4 months ago - Reply: 2 - Views: 115

.dll file missing after php upgrade

5 months ago - Reply: 1 - Views: 27

Notepad++ launch multiple HTML within browser

5 months ago - Reply: 0 - Views: 2

Access 2003 freezing

5 months ago - Reply: 0 - Views: 2

Icon Handler Shell Extension not called

5 months ago - Reply: 1 - Views: 23

Border color of combox does not change - Windows 8

5 months ago - Reply: 3 - Views: 140

VB.NET error DatagridViewCellValueChanged Windows 8

6 months ago - Reply: 1 - Views: 40

I made a mistake when installing Hyper-V [on hold]

6 months ago - Reply: 0 - Views: 7

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re