When I attempt to extract a thumbnail from a simple JPG in Windows 2000 I get
an error. This works fine in Windows XP and 2003 Server.
The error is 0x80004002 - "No such interface supported".
I have called ::CoInitializeEx(NULL, COINIT_MULTITHREADED); before running
this code.
Below is the code snippet showing the failure
DWORD dwPriority = 0;
DWORD dwFlags = IEIFLAG_SCREEN;
HBITMAP hBmpImage = NULL;
DWORD dwRecClrDepth = 8;
SIZE prgSize;
prgSize.cx = lRes;
prgSize.cy = lRes;
hr = pIExtract->GetLocation(wszPathBuffer, MAX_PATH, &dwPriority,
&prgSize, dwRecClrDepth, &dwFlags);
if(SUCCEEDED(hr))
{
// Failure occurs here... 0x80004002 is returned.
--> hr = pIExtract->Extract(&hBmpImage);
Matt Ellis - 29 Jun 2005 15:00 GMT
Raymond explains it very nicely here:
https://blogs.msdn.com/oldnewthing/archive/2004/12/13/281910.aspx
You need to be apartment threaded, not mulitthreaded.
Cheers
Matt
> When I attempt to extract a thumbnail from a simple JPG in Windows 2000 I get
> an error. This works fine in Windows XP and 2003 Server.
[quoted text clipped - 21 lines]
> // Failure occurs here... 0x80004002 is returned.
> --> hr = pIExtract->Extract(&hBmpImage);