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