掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
TStreamAdapterのメモリーリークの防止は (ID:34829)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
すみません。自己レスです。 自分がいじくり回した方を送りましたので、下記がオリジナルです。 function TForm1.GetSource: String; var Doc: IHTMLDocument2; Persist: IPersistStream; Mem: TStringStream; begin if WebBrowser1.Document = nil then Exit; Mem := TStringStream.Create(''); try Doc := WebBrowser1.Document as IHTMLDocument2; if Doc = nil then Exit; Persist := Doc as IPersistStreamInit; Persist.Save(TStreamAdapter.Create(Mem), True); Result := Mem.DataString; finally Mem.Free; end; end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.