简体   繁体   English

自定义PreviewPane-在Windows7中工作,在Vista中不工作

[英]Custom PreviewPane - Works in Windows7, not in Vista

I've written an explorer extension to display my custom file format in the Preview Pane. 我编写了一个资源管理器扩展程序,以在预览窗格中显示我的自定义文件格式。 This works fine in Windows 7, but doesn't seem to work in Vista. 这在Windows 7中可以正常工作,但在Vista中似乎不起作用。 The same DLL handles both thumbnails and the preview pane. 相同的DLL处理缩略图和预览窗格。 The thumbnails side of things work in both Vista and Windows7. 缩略图的一面在Vista和Windows7中均可使用。

Adding logs to my code, Vistas only calling my DllGetClassObject function for the thumbnail class, not the preview handler class. 将日志添加到我的代码中,Vista仅针对缩略图类而不是预览处理程序类调用DllGetClassObject函数。

Is there anything obvious that Vista does differently to Windows7 when calling COM DLLs? 调用COM DLL时,Vista与Windows7有什么明显区别吗?

Here's the values I'm adding to the registry: 这是我要添加到注册表中的值:

HKEY_CLASSES_ROOT\\.<myext>\\(default) = "<myext>.Thumbnail.Handler.1"
HKEY_CLASSES_ROOT\\<myext>.Thumbnail.Handler.1\\ShellEx\\{8895b1c6-b41f-4c1c-a562-0d564250836f}\\(default) = "<myguid>"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\(default) = "<myext> Preview Handler"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\DisplayName = "@ExplorerPreviewHandler.dll,-101"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\Icon = "@ExplorerPreviewHandler.dll,201"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\AppID = "{6d2b5079-2f0b-48dd-ab7f-97cec514d30b}"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\InProcServer32\\(default) = "<path to my dll>"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\InProcServer32\\ThreadingModel = "Apartment"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\InProcServer32\\ProgID = "<myext>.Thumbnail.Handler.1"
HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\PreviewHandlers\\<myguid> = "<myext> Preview Handler"},

Given that my DllGetClassObject isn't being called, I presume the problem must be something to do with what I'm setting in the registry? 鉴于没有调用我的DllGetClassObject,我认为问题一定与我在注册表中设置的内容有关吗? I know the DLL exports are okay, as it works for the thumbnails in both Vista and Win7, and works for the preview pane in Windows7. 我知道DLL导出是可以的,因为它适用于Vista和Win7中的缩略图,适用于Windows7中的预览窗格。

DLL is x64, as are both my Vista and Win7 OSs. DLL是x64,我的Vista和Win7操作系统也都是。 DLL is written in C++ without ATL. DLL是用C ++编写的,没有ATL。

Thankyou for any help with this, Dan. 谢谢您的帮助,丹,

The reg looks okayish, only the default progid is missing. 该注册表看起来还可以,只有默认的progid丢失了。 Win7 does have documented alternate behavior for the location of the PreviewHandlers key. Win7确实记录了PreviewHandlers键位置的替代行为。 Unfortunately the SDK docs don't say what Vista requires. 不幸的是,SDK文档没有说明Vista的要求。 A Vista time magazine article uses HKLM instead of HKCU. Vista时间杂志上的文章使用HKLM而不是HKCU。 I bet that's it. 我敢打赌就是这样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM