Translate from C++ to C#
- From: "PL" <pl_core@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 24 May 2005 16:56:02 -0400
Hi,
I would need the equivalent in C#, suggestion?
HRESULT LoadWebBrowserFromStream(IWebBrowser* pWebBrowser, IStream* pStream)
{
HRESULT hr;
IDispatch* pHtmlDoc = NULL;
IPersistStreamInit* pPersistStreamInit = NULL;
// Retrieve the document object.
hr = pWebBrowser->get_Document( &pHtmlDoc );
if ( SUCCEEDED(hr) )
{
// Query for IPersistStreamInit.
hr = pHtmlDoc->QueryInterface( IID_IPersistStreamInit,
(void**)&pPersistStreamInit );
if ( SUCCEEDED(hr) )
{
// Initialize the document.
hr = pPersistStreamInit->InitNew();
if ( SUCCEEDED(hr) )
{
// Load the contents of the stream.
hr = pPersistStreamInit->Load( pStream );
}
pPersistStreamInit->Release();
}
}
}
.
- Follow-Ups:
- Re: Translate from C++ to C#
- From: Frans Bouma [C# MVP]
- Re: Translate from C++ to C#
- Prev by Date: Re: read text file
- Next by Date: Re: Which is faster
- Previous by thread: HKEY_LOCAL_MACHINE Registry Access
- Next by thread: Re: Translate from C++ to C#
- Index(es):
Relevant Pages
|