如何获取 DShellFolderViewEvents 的方法签名

How to get the method signatures for DShellFolderViewEvents

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

您可以查看 shell32.dll 的类型库以获取接口声明。我使用 Visual Studio 附带的 oleview.exe 打开 DLL。界面看起来像这样:

 [
  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();
};