缩略图提供程序不工作

发布于 2024-08-31 10:05:39 字数 988 浏览 3 评论 0原文

我正在尝试为我们的自定义文件类型编写一个 Windows 资源管理器缩略图处理程序。我在预览窗格中可以正常工作,但在缩略图中却无法使用它。

Windows 似乎甚至没有尝试调用 DllGetClassObject 入口点。

在继续之前,请注意我使用的是 Windows 7 和非托管 C++。

我已在注册表中注册了以下值:

HKCR\CLSID\<my guid>
HKCR\CLSID\<my guid>\InprocServer32 (default value = path to my DLL)
HKCR\CLSID\<my guid>\InprocServer32\ThreadingModel (value = "Apartment")
HKCR\.<my ext>\shellex\{E357FCCD-A995-4576-B01F-234630154E96} (value = my guid)

我还尝试使用 Win SDK 示例,但这不起作用。还有本文中的示例项目 (http://www. codemonkeycodes.com/2010/01/11/ithumbnailprovider-re-visited/),这是行不通的。

我是 shell 编程的新手,所以不太确定调试这个的最佳方法。我尝试将调试器附加到 explorer.exe,但这似乎不起作用(断点被禁用,并且我的 OutputDebugStrings 都没有显示在输出窗口中)。请注意,我尝试按照 WinSDK 文档中的描述在注册表中设置“DesktopProcess”以调试 shell,但我仍然只在任务管理器中看到一个 explorer.exe - 所以“可能”就是我不能的原因调试一下??

任何对此的帮助将不胜感激!

问候, 担。

I'm trying to write a Windows Explorer thumbnail handler for our custom file type. I've got this working fine for the preview pane, but am having trouble getting it to work for the thumbnails.

Windows doesn't even seem to be trying to call the DllGetClassObject entry point.

Before I continue, note that I'm using Windows 7 and unmanaged C++.

I've registered the following values in the registry:

HKCR\CLSID\<my guid>
HKCR\CLSID\<my guid>\InprocServer32 (default value = path to my DLL)
HKCR\CLSID\<my guid>\InprocServer32\ThreadingModel (value = "Apartment")
HKCR\.<my ext>\shellex\{E357FCCD-A995-4576-B01F-234630154E96} (value = my guid)

I've also tried using the Win SDK sample, and that doesn't work. And also the sample project in this article (http://www.codemonkeycodes.com/2010/01/11/ithumbnailprovider-re-visited/), and that doesn't work.

I'm new to shell programming, so not really sure the best way of debugging this. I've tried attaching the debugger to explorer.exe, but that doesn't seem to work (breakpoints get disabled, and none of my OutputDebugStrings get displayed in the output window). Note that I tried setting the "DesktopProcess" in the registry as described in the WinSDK docs for debugging the shell, but I'm still only seeing one explorer.exe in the task manager - so that "may" be why I can't debug it??

Any help with this would be greatly appreciated!

Regards,
Dan.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

莳間冲淡了誓言ζ 2024-09-07 10:05:40

自从你提到我的博客(codemonkeycodes.com)以来,我偶然发现了这一点。

您对我的样品有什么问题吗?您是否使用 regsvr32 注册了 DLL?您使用的是哪个版本的 Windows 7,32 位还是 64 位?


更新:

我不能说什么对你有用,什么对你不起作用。我刚刚从我的网站下载了示例,按照说明操作并更改了功能
STDMETHODIMP CThumbnailProvider::GetThumbnail... 看起来

{
*phbmp = NULL;
*pdwAlpha = WTSAT_UNKNOWN;

ULONG_PTR token;
GdiplusStartupInput input;
if (Ok == GdiplusStartup(&token, &input, NULL))
{
    //gcImage.LogBuffer();
    Bitmap * pBitmap = new Bitmap(188, 141);
    if( pBitmap )
    {
        Color color(0, 0, 0);
        pBitmap->GetHBITMAP(color, phbmp);
    }
}

GdiplusShutdown(token);

if( *phbmp != NULL )
    return NOERROR;

return E_NOTIMPL;
}

我注册了 DLL,然后创建了一个具有正确扩展名的新文件,嗯,我有一个漂亮的黑色缩略图。

我希望我能帮助你。也许您想通过电子邮件将您的代码发送给我?

I stumbled across this since you mentioned my blog ( codemonkeycodes.com ).

What problem are you having with my sample? Did you register you DLL using regsvr32? What version of Windows 7 are you on, 32 or 64?


Update:

I can't say what is or isn't working for you. I just downloaded the sample from my site, followed the directions and change the function
STDMETHODIMP CThumbnailProvider::GetThumbnail... to look like

{
*phbmp = NULL;
*pdwAlpha = WTSAT_UNKNOWN;

ULONG_PTR token;
GdiplusStartupInput input;
if (Ok == GdiplusStartup(&token, &input, NULL))
{
    //gcImage.LogBuffer();
    Bitmap * pBitmap = new Bitmap(188, 141);
    if( pBitmap )
    {
        Color color(0, 0, 0);
        pBitmap->GetHBITMAP(color, phbmp);
    }
}

GdiplusShutdown(token);

if( *phbmp != NULL )
    return NOERROR;

return E_NOTIMPL;
}

I registered the DLL and then created a new file with the proper extension, and tada, I had a nice black thumbnail.

I wish I could help you. Maybe you want to email me your code?

失去的东西太少 2024-09-07 10:05:40

我有完全相同的问题。我无法制作 SDK 或任何示例作品。我需要 COM 示例,因为我必须调用仅适用于 32 位系统的 Microsoft.Jet.OLEDB.4.0。

我无法完成这项工作: 链接

如果编译时指定了 AnyCPU,则此方法有效。无法使其适用于 x86: 链接

这在 XP 下很好用,就像一个魅力: 链接

这表明Adobe在缩略图方面存在问题带有Office 2007(32位)的MS: 链接

I've exactly the same problem. I cant make SDK or any sample works. I need COM sample because I must call Microsoft.Jet.OLEDB.4.0 which works only on 32 bits system.

I couldnt make this work: link

This works if AnyCPU is specified when compiling. Cant make it works for x86: link

This was nice under XP works like a charm: link

This show Adobe had problems with thumbnail An MS with Office 2007 (32 bits): link

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文