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

查看:72
本文介绍了如何获取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天全站免登陆