Void __fastcall tform1 :: sethtml (tcppWebBrowser * Webbrowser, Ansistring HTML) {istream * stream; hglobal hhtmltext; ipersiststreaminit * psi;
IF (webbrowser-> docuument == null) return; hhtmltext = GlobalAlloc (gptr, html.length () 1); if (0 == hhtmltext) {ShowMessage ("GlobalAlloc Error"; Return;}
CopyMemory (hhtmltext, html.c_str (), html.length ());
Olecheck (CreateStreamonhglobal (HHTMLText, True, & Stream);
Try {olecheck (WebBrowser-> Document-> queryinterface (__UUIDOF (iPersistStreaminit), (void **) & psi); try {olecheck (psi-> initnew ()); olecheck (psi-> load (stream));} Catch (...) {delete psi;}} catch (...) {delete stream; delete stream;