Q&A

  • 소스 좀 봐 주세요
unit Unit1;



interface



uses

Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

StdCtrls, OleCtrls, SHDocVw;



type

TForm1 = class(TForm)

WebBrowser: TWebBrowser;

Button1: TButton;

Button2: TButton;

procedure Button1Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;



var

Form1: TForm1;



implementation



{$R *.DFM}



procedure TForm1.Button1Click(Sender: TObject);

begin

webbrowser.Navigate('http://www.dephi.co.kr');

end;



procedure TForm1.Button2Click(Sender: TObject);

var

VI, VO: OleVariant;

IECommand: IOleCommandTarget;

begin

IECommand := WebBrowser.Document as IOleCommandTarget;

IECommand.Exec(nil, OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, VI,

VO);

end;



end.



에러 메세지

[Error] Unit1.pas(37): Undeclared identifier: 'IOleCommandTarget'

[Error] Unit1.pas(39): Operator not applicable to this operand type

[Error] Unit1.pas(40): Missing operator or semicolon

[Fatal Error] Project2.dpr(5): Could not compile used unit 'Unit1.pas'



초보라서...

아시는 분 설명 좀 부탁합니다.

1  COMMENTS
  • Profile
    조규춘 2000.09.29 08:49
    조헌철 wrote:

    > unit Unit1;

    >

    > interface

    >

    > uses

    > Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

    > StdCtrls, OleCtrls, SHDocVw;

    >

    > type

    > TForm1 = class(TForm)

    > WebBrowser: TWebBrowser;

    > Button1: TButton;

    > Button2: TButton;

    > procedure Button1Click(Sender: TObject);

    > procedure Button2Click(Sender: TObject);

    > private

    > { Private declarations }

    > public

    > { Public declarations }

    > end;

    >

    > var

    > Form1: TForm1;

    >

    > implementation

    >

    > {$R *.DFM}

    >

    > procedure TForm1.Button1Click(Sender: TObject);

    > begin

    > webbrowser.Navigate('http://www.dephi.co.kr');

    > end;

    >

    > procedure TForm1.Button2Click(Sender: TObject);

    > var

    > VI, VO: OleVariant;

    > IECommand: IOleCommandTarget;

    > begin

    > IECommand := WebBrowser.Document as IOleCommandTarget;

    > IECommand.Exec(nil, OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, VI,

    > VO);

    > end;

    >

    > end.

    >

    > 에러 메세지

    > [Error] Unit1.pas(37): Undeclared identifier: 'IOleCommandTarget'

    > [Error] Unit1.pas(39): Operator not applicable to this operand type

    > [Error] Unit1.pas(40): Missing operator or semicolon

    > [Fatal Error] Project2.dpr(5): Could not compile used unit 'Unit1.pas'

    >

    > 초보라서...

    > 아시는 분 설명 좀 부탁합니다.



    헌철 동상 여기에도 질문을 했군...



    델세상(http://www.freechal.com/delphiworld)에도 답변했지만



    unit 에다가 ActiveX를 첨가하게나......