19,468
社区成员
发帖
与我相关
我的任务
分享
//IPicture * pPicture = NULL;已载入图片
CComPtr<IStream> pfilestram;
CreateStreamOnHGlobal(NULL,TRUE,&pfilestram);
LONG size;
hr=pPicture->SaveAsFile(pStream,TRUE,&size);
char pathbuf[1024];
CFile iconfile;
iconfile.Open(TEXT("c:\\bb.bmp"), CFile::modeCreate|CFile::modeWrite);
LARGE_INTEGER li;
li.HighPart =0;
li.LowPart =0;
ULARGE_INTEGER ulnewpos;
pStream->Seek( li,STREAM_SEEK_SET,&ulnewpos);
ULONG uReadCount = 1;
while(uReadCount>0)
{
pStream->Read(pathbuf,sizeof(pathbuf),&uReadCount);
if(uReadCount>0)
iconfile.Write(pathbuf,uReadCount);
}