Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 Q&A
Delphi Programming Q&A
[12961] 볼랜드포럼사이트의 프레임갯수를 구할려고 하는데 오류가 납니다.
이재진 [gksmf] 2180 읽음    2009-11-09 14:32
안녕하세요
먼저 사이트의 프레임의 갯수와 링크주소를 알기위해서 다음과 같이 소스를 입력했습니다
델마당 도메인은 정상적으로 프레임갯수와 프레임링크주소가 나오는데 볼랜드포럼에서는
에러메시지가 출력이 됩니다. 제사이트및 타사이트는 다 정상적으로 에러가 없습니다.
하지만 볼랜드포럼및 몇몇만 그러네요

위와같이 에러가 발생하는 이유가 무엇인지 궁금합니다.
에러가 나는 부분은 다음과 같습니다.
this_url  := EmbeddedWB1.OleObject.Document.Frames.item(i).Document.URL;

에러이미지는 첨부파일로 올려놓았습니다.
도움부탁드립니다.~


예제: 원본소스


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, OleCtrls, SHDocVw, EmbeddedWB, MSHTML, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    EmbeddedWB1: TEmbeddedWB;
    procedure Button1Click(Sender: TObject);
    procedure EmbeddedWB1DocumentComplete(Sender: TObject;
      const pDisp: IDispatch; var URL: OleVariant);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);

begin

  EmbeddedWB1.Navigate('http://borlandforum.com/');

end;

procedure TForm1.EmbeddedWB1DocumentComplete(Sender: TObject;
  const pDisp: IDispatch; var URL: OleVariant);

var

  i: Integer;
  this_url : String;

CurWebrowser: IWebBrowser;
TopWebBrowser: IWebBrowser;
Document: OleVariant;
WindowName: string;


begin

CurWebrowser := pDisp as IWebBrowser;
TopWebBrowser := (Sender as TWebBrowser).DefaultInterface;


if CurWebrowser = TopWebBrowser then begin


  if EmbeddedWB1.OleObject.Document.Frames.Length <> 0 then
  begin
   showmessage('프레임존재');
    for i := 0 to EmbeddedWB1.OleObject.Document.Frames.Length - 1 do
    begin
  this_url  := EmbeddedWB1.OleObject.Document.Frames.item(i).Document.URL;
  showmessage(this_url);
    end;
  end;


end else begin
Document := CurWebrowser.Document;
WindowName := Document.ParentWindow.Name;
//ShowMessage(Format('Frame "%s" was loaded', [WindowName]));
end;


end;

+ -

관련 글 리스트
12961 볼랜드포럼사이트의 프레임갯수를 구할려고 하는데 오류가 납니다. 이재진 2180 2009/11/09
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.