Thumbnail player not working

I am trying to write a Windows Explorer thumbnail handler for our custom file type. This work for me is great for the preview panel, but I have problems with its work for thumbnails.

Windows does not even try to call the entry point DllGetClassObject.

Before continuing, please note that I am using Windows 7 and unmanaged C ++.

I 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 also tried using the Win SDK sample and this does not work. As well as a sample project in this article ( http://www.codemonkeycodes.com/2010/01/11/ithumbnailprovider-re-visited/ ), and this does not work.

I am new to shell programming, so not sure if the best way to debug this. I tried connecting the debugger to explorer.exe, but this does not work (breakpoints are disabled, and none of my OutputDebugStrings is displayed in the output window). Please note that I tried to install "DesktopProcess" in the registry as described in the WinSDK docs for debugging the shell, but I still see only one explorer.exe in the task manager, so "maybe", so I can not debug it?

Any help with this would be greatly appreciated!

Regards, Dan.

+4
source share
2 answers

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

What is your problem with my sample? Have you registered the dll using regsvr32? What version of Windows 7 are you using, 32 or 64?


Update:

I can not say what is for you or does not work. I just downloaded the sample from my site, followed the directions and changed 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 corresponding extension, and tada, I had a beautiful black sketch.

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

+5
source

I have exactly the same problem. I can not do the SDK or any sample work. I need a COM sample because I have to call Microsoft.Jet.OLEDB.4.0, which only works on a 32-bit system.

I could not do this job: link

This works if AnyCPU is specified at compile time. Can't make it work for x86: link

It was good in XP, it works like a charm: link

This shows that Adobe has problems with MS thumbnail with Office 2007 (32 bit): link

+1
source

Source: https://habr.com/ru/post/1308362/


All Articles