现在发现我的程序的SHELL扩展右键菜单和其它程序的SHELL扩展右键菜单冲突。
安装后导致其它程序(如7-zip,noptead++)的SHELL扩展右键菜单不能使用。
这有可能是什么原因造成的?
怎样解决?谢谢

解决方案 »

  1.   

    用的guid一样,或注册表操作有问题,你贴代码吧
      

  2.   

    EShell.idl
    // EShell.idl : IDL source for EShell
    //// This file will be processed by the MIDL tool to
    // produce the type library (EShell.tlb) and marshalling code.import "oaidl.idl";
    import "ocidl.idl";[
    object,
    uuid(4A6BEA05-8DAE-4C18-9618-4E839EC21922),
    dual,
    nonextensible,
    helpstring("IEShellExt Interface"),
    pointer_default(unique)
    ]
    interface IEShellExt : IDispatch{
    };
    [
    uuid(C97F4596-DD05-4F45-AAF3-FBAC0743E61F),
    version(1.0),
    helpstring("EShell 1.0 Type Library")
    ]
    library EShellLib
    {
    importlib("stdole2.tlb");
    [
    uuid(00C281BC-1E70-41FD-AD94-A3FE615A9663),
    helpstring("EShellExt Class")
    ]
    coclass EShellExt
    {
    [default] interface IEShellExt;
    };
    };
      

  3.   

    EShell.rgs
    HKCR
    {
    NoRemove *
    {
    NoRemove ShellEx
    {
    NoRemove ContextMenuHandlers
    {
    ForceRemove PilotEdit = s '{00C281BC-1E70-41FD-AD94-A3FE615A9663}'
    }
    }
    }
    }
      

  4.   

    EShellExt.h
    // EShellExt.h : Declaration of the CEShellExt#pragma once
    #include "resource.h"       // main symbols#include "EShell_i.h"
    #if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
    #error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
    #endif#define CL_MAX_PATH_LEN 2100
    #define LENGTH_MAX_BUFF 5000// CEShellExtclass ATL_NO_VTABLE CEShellExt :
    public CComObjectRootEx<CComSingleThreadModel>,
    public CComCoClass<CEShellExt, &CLSID_EShellExt>,
    public IDispatchImpl<IEShellExt, &IID_IEShellExt, &LIBID_EShellLib, /*wMajor =*/ 1, /*wMinor =*/ 0>,
    public IShellExtInit,
    public IContextMenu
    {
    public:
    CEShellExt()
    {
    }

    //Variables
    TCHAR m_szSysDirectory[CL_MAX_PATH_LEN];
    TCHAR  m_wszTempBuffer[LENGTH_MAX_BUFF];
    static CStringArray m_stringArrayFileNames;
    HBITMAP m_hRegBmp;

    //Functions
    BOOL RegisterSysOpenFile(CStringArray & m_stringArrayFileNames);
    DECLARE_REGISTRY_RESOURCEID(IDR_ESHELLEXT)
    BEGIN_COM_MAP(CEShellExt)
    COM_INTERFACE_ENTRY(IEShellExt)
    COM_INTERFACE_ENTRY(IDispatch)
    COM_INTERFACE_ENTRY(IShellExtInit)
    COM_INTERFACE_ENTRY(IContextMenu)
    END_COM_MAP() DECLARE_PROTECT_FINAL_CONSTRUCT() HRESULT FinalConstruct()
    {
    return S_OK;
    } void FinalRelease()
    {
    }public:
    // IShellExtInit
    STDMETHOD(Initialize)(LPCITEMIDLIST, LPDATAOBJECT, HKEY);
    public:
    // IContextMenu
    STDMETHOD(GetCommandString)(UINT, UINT, UINT*, LPSTR, UINT);
    STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO);
    STDMETHOD(QueryContextMenu)(HMENU, UINT, UINT, UINT, UINT);};OBJECT_ENTRY_AUTO(__uuidof(EShellExt), CEShellExt)