如何获取 DShellFolderViewEvents 的方法签名 [英] How to get the method signatures for DShellFolderViewEvents

查看:14
本文介绍了如何获取 DShellFolderViewEvents 的方法签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 ATL 接收 DShellFolderViewEvents,而我能够成功订阅的唯一方法是 DISPID_SELECTIONCHANGED.标题 shdispid.h 中似乎列出了许多其他事件,但我无法触发它们.不确定我做错了什么(它可能与 ATL 相关),但我想也许我正在使用错误的签名实现事件处理函数(目前我只是在尝试没有参数的 void 函数).问题是似乎没有描述 DShellFolderViewEvents 方法的文档.有谁知道如何解决这些问题?

I'm trying to sink DShellFolderViewEvents using the ATL, and the only method I've been able to successfully subscribe to is DISPID_SELECTIONCHANGED. There appear to be many other events listed in the header shdispid.h, but I can't get them to fire. Not sure what I'm doing wrong (it might be ATL-related), but I thought perhaps I'm implementing event-handler functions with the wrong signatures (currently I'm just trying void functions with no arguments). The problem is that there doesn't appear to be documentation describing the DShellFolderViewEvents methods. Anyone know how to figure those out?

推荐答案

可以查看shell32.dll的类型库来获取接口声明.我使用 Visual Studio 附带的 oleview.exe 打开 DLL.界面如下所示:

You can look at the type library for shell32.dll to get the interface declaration. I used oleview.exe which comes with Visual Studio to open the DLL. The interface looks something like this:

 [
  uuid(62112AA2-EBE4-11CF-A5FB-0020AFE7292D),
  helpstring("Event interface for ShellFolderView")
]
dispinterface DShellFolderViewEvents {
    properties:
    methods:
        [id(0x000000c8), helpstring("The Selection in the view changed.")]
        void SelectionChanged();
        [id(0x000000c9), helpstring("The folder has finished enumerating (flashlight is gone).")]
        void EnumDone();
        [id(0x000000ca), helpstring("A verb was invoked on an items in the view (return false to cancel).")]
        VARIANT_BOOL VerbInvoked();
        [id(0x000000cb), helpstring("the default verb (double click) was invoked on an items in the view (return false to cancel).")]
        VARIANT_BOOL DefaultVerbInvoked();
        [id(0x000000cc), helpstring("user started to drag an item (return false to cancel).")]
        VARIANT_BOOL BeginDrag();
};

这篇关于如何获取 DShellFolderViewEvents 的方法签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆