开发者

Implementing a Windows Explorer extension view interface

I have a Visual Studio 2008 C++ ATL project that is a namespace extension for Windows Explorer.

In the tool bar rebar for Windows Explorer in Windows XP, there is an icon labeled "views". In a normal view, it creates a drop-down menu that allows the user to select "Thumbnails", "Tiles", "Icons", "List", or "Details" as the view type.

What interface do I need to implement in my project for this button? At present, I implement IShellFolder and IShellView. When I click the "Views" button while in my namespace, nothing happens. No menu is shown and the user is not given the option of changing views.

Thanks, PaulH


Edit: This is my implementation of IShellView, IServiceProvider, and IFolderView

class ATL_NO_VTABLE CShellViewImpl :
    public CComObjectRootEx< CComSingleThreadModel >,
    public CComCoClass< CShellViewImpl, &CLSID_ShellViewImpl >,
    public IDispatchImpl< IShellViewImpl, 
                          &IID_IShellViewImpl, 
                          &LIBID_MyLib, 
                          /*wMajor =*/ 1, 
                          /*wMinor =*/ 0 >,
    public IShellView,
    public IServiceProvider,
    public IFolderView
{
public:
    DECLARE_REGISTRY_RESOURCEID( IDR_SHELLVIEWIMPL )

    BEGIN_COM_MAP( CShellViewImpl )
        COM_INTERFACE_ENTRY( IShellViewImpl )
        COM_INTERFACE_ENTRY( IServiceProvider )
        COM_INTERFACE_ENTRY( IDispatch )
        COM_INTERFACE_ENTRY( IShellView )
        COM_INTERFACE_ENTRY( I开发者_JAVA技巧FolderView )
    END_COM_MAP()

    DECLARE_PROTECT_FINAL_CONSTRUCT()

    // IXYZ implementations...
};

IServiceProvider::QueryService() is never called


Try IFolderView::SetCurrentViewMode

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜