实现 Windows 资源管理器扩展视图界面
我有一个 Visual Studio 2008 C++ ATL 项目,它是 Windows 资源管理器的命名空间扩展。
在 Windows XP 中 Windows 资源管理器的工具栏中,有一个标记为“视图”的图标。在普通视图中,它会创建一个下拉菜单,允许用户选择“缩略图”、“平铺”、“图标”、“列表”或“详细信息”作为视图类型。
我需要在我的项目中为此按钮实现什么接口?目前,我实现了IShellFolder和IShellView。当我在命名空间中单击“视图”按钮时,没有任何反应。不显示菜单,并且用户没有更改视图的选项。
谢谢, PaulH
编辑:这是我对 IShellView、IServiceProvider 和 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( IFolderView )
END_COM_MAP()
DECLARE_PROTECT_FINAL_CONSTRUCT()
// IXYZ implementations...
};
IServiceProvider::QueryService() 从未被调用
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( IFolderView )
END_COM_MAP()
DECLARE_PROTECT_FINAL_CONSTRUCT()
// IXYZ implementations...
};
IServiceProvider::QueryService() is never called
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试 IFolderView::SetCurrentViewMode
Try IFolderView::SetCurrentViewMode