Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TCppWebBrowser need to display an html page

19 views
Skip to first unread message

Ranjita Km

unread,
Feb 10, 2010, 7:02:14 AM2/10/10
to
This code works with errors first it throws exception then on
continuing to run the program and repeated clicks on the button
function it finally displays the html page. I had used javascripts in
Visual c++ but problems with borland component.
Can anyone guide me?


wchar_t url [256];
StringToWideChar ("ohm.html", url, 256);
CppWebBrowser1-> Navigate (url, NULL, NULL, NULL, NULL);

TMemoryStream *stm = new TMemoryStream();
Memo1->Lines->SaveToStream(stm);

IPersistStreamInit *psi;
stm->Seek(0,0);

//if you pass soOwned instead, the stream will be freed for you
TStreamAdapter *sa = new TStreamAdapter(stm,soReference);

if (SUCCEEDED(CppWebBrowser1->Document-
>QueryInterface(IID_IPersistStreamInit,(void **)&psi)))
psi->Load(*sa);

delete stm;

0 new messages