опубликован 19-07-2001 16:27 MSK
:)
IHTMLDocument2* document = (IHTMLDocument2*)m_Browser.GetDocument();
IPersistStreamInitPtr PerStream = NULL;
HRESULT hresult = S_OK; hresult = document->QueryInterface(IID_IPersistStreamInit,(void**)&PerStream);
if(SUCCEEDED(hresult))
{
IStreamPtr pStr = NULL;
CreateStreamOnHGlobal(NULL,TRUE,&pStr);
hresult = PerStream->Save(pStr,TRUE);
ULARGE_INTEGER uMaxSize, nowPosition;
LARGE_INTEGER setPosition = {0};
ULONG RealRead = 0;
hresult = pStr->Seek(setPosition,STREAM_SEEK_END,&uMaxSize);
BYTE *pBuff = new BYTE[uMaxSize.LowPart];
hresult = pStr->Seek(setPosition,STREAM_SEEK_SET,&nowPosition);
hresult = pStr->Read((void**)pBuff,uMaxSize.LowPart,&RealRead);
}
Советую посмотреть в MSDN "Loading HTML content from a Stream"
URL: mk:@MSITStore:C:\Program%20Files\Microsoft%20Visual%20Studio\MSDN\2000OCT\1033\inet.chm::/workshop/browser/webbrowser/tutorials/webocstream.htm#stream