刚接触com,想用个
IThumbnailCapture Interface http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/ithumbnailcapture/ithumbnailcapture.asp
是这样定义的
#if (_WIN32_IE >= 0x0400)/* ***************** IThumbnailCapture
* CaptureThumbnail : takes an IHTMLDocument2 and returns a thumbnail of specified
* size as an hbitmap
*/#undef INTERFACE
#define INTERFACE IThumbnailCaptureDECLARE_INTERFACE_ ( IThumbnailCapture, IUnknown )
{
// *** IThumbnailCapture methods ***
STDMETHOD (CaptureThumbnail) ( THIS_ const SIZE * pMaxSize,
IUnknown * pHTMLDoc2,
HBITMAP * phbmThumbnail ) PURE;
};
typedef IThumbnailCapture * LPTHUMBNAILCAPTURE;#endif无奈com一知半解,试着实现了一下
提示IThumbnailCapture' : base class undefined
请教高牛们啊。
============附我的实现,com刚看了几眼,实在是...==============
#include "shlobj.h"
#include <INITGUID.H>DEFINE_GUID(IID_IExtractImage, 0xbb2e617c, 0x920, 0x11d1, 0x9a, 0xb, 0x0, 0xc0, 0x4f, 0xc2, 0xd6, 0xc1);class CICustomThumbnailCapture:public IThumbnailCapture
{
public:
STDMETHOD (CaptureThumbnail)( THIS_ const SIZE * pMaxSize,
IUnknown * pHTMLDoc2,
HBITMAP * phbmThumbnail ){
return S_OK;
}
STDMETHODIMP QueryInterface(REFIID iid, LPVOID* ppvObj){
if (iid == IID_IUnknown || iid == IID_IExtractImage)
{
*ppvObj = this;
return S_OK;
}
return S_FALSE;
}
STDMETHODIMP_(ULONG) AddRef(){
return 1;
}
STDMETHODIMP_(ULONG) Release(){
return 1;
}
};
IThumbnailCapture Interface http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/ithumbnailcapture/ithumbnailcapture.asp
是这样定义的
#if (_WIN32_IE >= 0x0400)/* ***************** IThumbnailCapture
* CaptureThumbnail : takes an IHTMLDocument2 and returns a thumbnail of specified
* size as an hbitmap
*/#undef INTERFACE
#define INTERFACE IThumbnailCaptureDECLARE_INTERFACE_ ( IThumbnailCapture, IUnknown )
{
// *** IThumbnailCapture methods ***
STDMETHOD (CaptureThumbnail) ( THIS_ const SIZE * pMaxSize,
IUnknown * pHTMLDoc2,
HBITMAP * phbmThumbnail ) PURE;
};
typedef IThumbnailCapture * LPTHUMBNAILCAPTURE;#endif无奈com一知半解,试着实现了一下
提示IThumbnailCapture' : base class undefined
请教高牛们啊。
============附我的实现,com刚看了几眼,实在是...==============
#include "shlobj.h"
#include <INITGUID.H>DEFINE_GUID(IID_IExtractImage, 0xbb2e617c, 0x920, 0x11d1, 0x9a, 0xb, 0x0, 0xc0, 0x4f, 0xc2, 0xd6, 0xc1);class CICustomThumbnailCapture:public IThumbnailCapture
{
public:
STDMETHOD (CaptureThumbnail)( THIS_ const SIZE * pMaxSize,
IUnknown * pHTMLDoc2,
HBITMAP * phbmThumbnail ){
return S_OK;
}
STDMETHODIMP QueryInterface(REFIID iid, LPVOID* ppvObj){
if (iid == IID_IUnknown || iid == IID_IExtractImage)
{
*ppvObj = this;
return S_OK;
}
return S_FALSE;
}
STDMETHODIMP_(ULONG) AddRef(){
return 1;
}
STDMETHODIMP_(ULONG) Release(){
return 1;
}
};
是不是要包含IThumbnailCapture的话
shlobj.h
shlobj.h
你定义的_WIN32_IE是不是满足这个条件?