gpt4 book ai didi

c++ - IThumbnailProvider 和 IInitializeWithItem

转载 作者:搜寻专家 更新时间:2023-10-31 01:23:16 27 4
gpt4 key购买 nike

我正在尝试开发用于 Windows 7 的 IThumbnailProvider。由于这个特定的缩略图还依赖于同一目录中的其他一些文件,因此我需要使用 以外的东西IInitializeWithStream 到要使用的路径,这是 IInitializeWithItem。 (或者,我可以使用 IInitializeWithFile,但显然更不受欢迎。)

无论我做什么,我都无法让它工作。我有 Microsoft 的 FileTypeVerifier.exe 工具,它为使用 IInitializeWithItem 开了绿灯,但是当资源管理器调用它时,它似乎只尝试 IInitializeWithStream,曾经。 (这是通过临时实现所述接口(interface)测试的,并且 Beep() 在它的 Initialize() 中消失了)我是不是忘记配置什么了?

简而言之:如何让它发挥作用?

最佳答案

好吧,我终于知道是怎么回事了。引用 MSDN 网站上的Building Thumbnail Providers 链接:

There are cases where initialization with streams is not possible. In scenarios where your thumbnail provider does not implement IInitializeWithStream, it must opt out of running in the isolated process where the system indexer places it by default when there is a change to the stream. To opt out of the process isolation feature, set the following registry value.

  • HKEY_CLASSES_ROOT

    • CLSID
    • {66742402-F9B9-11D1-A202-0000F81FEDEE}

      DisableProcessIsolation = 1

自从我在别处读到缩略图提供者总是用完进程后,我就知道我的进程用完了。但由于该特定片段几乎在所有 shell 扩展处理程序上,我将其解释为一个过于愉快的复制粘贴工作,因为它是-需要-以我理解的方式在进程中运行。

我错了。我希望这会在不久的将来帮助其他人。 :)

关于c++ - IThumbnailProvider 和 IInitializeWithItem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1733272/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com