아래 [소스에서] undeclared indentifier: 'FWebHandle'라고 나와서
이 Line을 막았더니
object or class type required
라고 나오면서 실행도 되지 않네요.
답변 좀 부탁드립니다.
[소스]
unit HTraining_U;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, SpeedBar, StdCtrls, ExtCtrls, ComCtrls, DB, MemDS, DBAccess,
MSAccess, Grids, DBGrids, ToolEdit, DBCtrls, Mask, Buttons, Label3dB,
BaseGrid, AdvGrid, CurrEdit, DBTables, RXCtrls, Printers, RxGIF, Psock,
OleCtrls, SHDocVw;
type
THTraining_F = class(TForm)
WebBrowser1: TWebBrowser;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure MessageLoop(var Msg:TMsg; var Handled:Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
HTraining_F: THTraining_F;
implementation
uses Common_U, Main_U;
{$R *.dfm}
procedure THTraining_F.MessageLoop(var Msg: TMsg; var Handled: Boolean);
Const
DialogKeys : Set of Byte = [VK_RETURN];
MSJVMClassName = 'MSAWT_Comp_Class'; // for Java Applets
Var
iOIPAO : IOleInPlaceActiveObject;
Dispatch : IDispatch;
Str : String;
begin
// WebBrowser의 도큐멘트 표시 부분의 핸들이 아닌 경우에는 무시
if Msg.hwnd <> FWebHandle then Exit;
if ((Msg.Message = WM_KEYDOWN) or (Msg.Message = WM_KEYUP)) and
(Msg.wParam in DialogKeys) then Begin
Handled:= IsDialogMessage(WebBrowser.Handle, msg) = True;
SetLength(Str, MAX_PATH);
GetClassName(Msg.hwnd, PChar(Str), MAX_PATH);
SetLength (Str, StrLen (PChar(Str)));
if (Msg.wParam = VK_DELETE) and (Str = MSJVMClassName) then
else
if Handled then
if FOleInPlaceActiveObject <> Nil then
FOleInPlaceActiveObject.TranslateAccelerator(Msg)
else
begin
Dispatch := IDispatch(WebBrowser.Application);
if Dispatch <> Nil then
begin
Dispatch.QueryInterface(IID_IOleInPlaceActiveObject, iOIPAO);
if iOIPAO <> Nil then
FOleInPlaceActiveObject := iOIPAO;
end;
end;
end else Handled:= False;
end;
// FORM CREATE시 하는 작업들..
procedure THTraining_F.FormCreate(Sender: TObject);
begin
self.Left := 125; self.top := 150;
Application.OnMessage:= MessageLoop;
WebBrowser1.Navigate('
http://www.amisnet.co.kr');
end;
// Form Close시에 하는 것들.
procedure THTraining_F.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end;
end.