Ms is TMemoryStream * ms;
(WebBrowser. Document as IPersistStreamInit). The Load (TStreamAdapter. Create (ms));
CodePudding user response:
Should be the examplehttp://comeoffbest.blog.163.com/blog/static/918935652009928454263/
OleCheck (WebBrowser - & gt; The Document - & gt; QueryInterface (__uuidof (IPersistStreamInit), (void * *) & amp; Psi));
OleCheck (psi - & gt; Load (Stream));
CodePudding user response:
Is not this, but you can reference, dongdong, I pasted the code,procedure WBLoadHTML (WebBrowser: TWebBrowser; HTMLCode: string);
Var
Sl: TStringList;
Ms: TMemoryStream;
The begin
The WebBrowser. Navigate (' the about: blank);
While the WebBrowser. ReadyState & lt; READYSTATE_INTERACTIVE do
Application. ProcessMessages;
If Assigned (WebBrowser. Document) then
The begin
Sl:=TStringList. Create;
Try
Ms:=TMemoryStream. Create;
Try
Sl. Text:=HTMLCode;
Sl. SaveToStream (ms);
Ms. Seek (0, 0);
(WebBrowser. Document as IPersistStreamInit). The Load (TStreamAdapter. Create (ms));
The finally
Ms. The Free;
end;
The finally
Sl. Free;
end;
end;
end;
Procedure TForm1. FormCreate (Sender: TObject);
Var
SHTML: string;
The begin
SHTML:='& lt; A href="http://delphi.about.com" & gt; GOTO + '
'& lt; B> The About Delphi Programming ';
WBLoadHTML (WebBrowser1 sHTML);
end;
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
CodePudding user response:
Required rabbit rabbit, broken and scattered, Thailand's resistance.Google "site:csdn.net ccrun IPersistStreamInit IHTMLDocument2"
Have a pleasant surprise.
CodePudding user response:
Read the two demon elder brother post, routine code to run successfully, but and I said, in fact, I just want to know how that displays the contents of a memory inside this bit of code, and the CPPweb... And that what difference?