linyawen

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

wbRecvContent//为 webbrowser控件

 

procedure TFrmMain.ShowHtmlCentent(slt: TStrings);

var

  aMemory: TMemoryStream;

  pbuf: PAnsiChar;

begin

  aMemory := TMemoryStream.Create();

  try

    aMemory.Clear;

    slt.SaveToStream(aMemory);

    aMemory.Seek(0, soBeginning);

    wbRecvContent.Navigate('about:blank');

    while wbRecvContent.ReadyState < READYSTATE_INTERACTIVE do

      Application.ProcessMessages;

    if Assigned(wbRecvContent.Document) then

      (wbRecvContent.Document as IPersistStreamInit).Load(TStreamAdapter.Create(aMemory));

  finally

    FreeAndNil(aMemory);

  end;

end;

posted on 2011-09-16 13:59  linyawen  阅读(785)  评论(0编辑  收藏  举报