If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Problem getting thumbnails

Hi everyone, I'm very new to C++ so please go easy on me. I'm using a very simple DLL to get a thumbnail for a file and add it to an imagelist. The problem is, whenever I pass a pidl that points to a text document (*.txt), something goes wrong and the development environment for the app using the DLL freezes. Any other file type successfully returns either the thumbnail or file icon.

I haven't used those image factory functions so can't really comment on the problem - but does the .txt file contain images or anything unusual? Also, the DeleteObject(hbmp) function will never be called as it is after the return statement.

Last edited by 2kaud; July 6th, 2013 at 07:54 AM.

All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Re: Problem getting thumbnails

Originally Posted by fafalone

Please hold the snickering, legacy programming has its place

Your case is definitely not about legacy programming. It's about, in case your explanation is correct, development environment freezing under certain circumstances. If I were you, I would either change the IDE or find some other way for debugging this code fragment. Or make sure my VS has every single recommended service pack installed, and if it does, I would send a complaint to MS support and see what they be able to come up with.

Re: Problem getting thumbnails

Ok, the compiled EXE just hangs like the IDE did. 0 CPU usage too.

I found a way to work around it; specify SIIGBF_THUMBNAILONLY for only those files that support it. Any other set of flags doesn't hang. But I can't just use other flags because it doesn't return the thumbnail for image files unless that flag is there (it should, but doesn't, probably because they're disabled in explorer).

So I guess that's the easy way. But is there a simple way to determine which file types have support for IShellImageFactory? Since additional preview handlers can be installed it's not a static list. And the only example I could seem to find was monstrously complicated (to someone who doesn't know C++) and didn't actually return extensions, only types, for some files.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.