線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1612
推到 Plurk!
推到 Facebook!

如何实现frame中的字链接???谢谢指教!!!

答題得分者是:hagar
rainfoot
一般會員


發表:9
回覆:17
積分:5
註冊:2003-05-03

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-05-13 09:48:34 IP:211.92.xxx.xxx 未訂閱
我现在在用的delphi7自带的intraweb制做网页,在网页中有一些超链接的文字要在每一页中都出现,为了避免麻烦,我就把它做在了一个frame1上这样在每一form中我只要添加一个类frame1就可以实现实现整体的调用! 但现在的问题是我在使用类似于demo/intraweb/feature/ 字链接时,模仿范例,我也用了一个move函数,但是在frame中的字链接始终无法运行,系统提示我说, [Error] Framemain.pas(41): Undeclared identifier: 'WebApplication' [Error] Framemain.pas(41): ')' expected but identifier 'ActiveForm' found [Error] Framemain.pas(31): Unsatisfied forward or external declaration: 'TFrame3.Create' 但是,同样的方法,我却在form中使用同样的方法,就可以实现字链接。由于刚刚接触,object pascal很不熟悉,出了问题就束手无策了! 希望高手能给我指点一下! demo中的例子我看了,但找不出毛病之所在! 谢谢!!!
hagar
版主


發表:143
回覆:4056
積分:4445
註冊:2002-04-14

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-05-13 10:05:06 IP:202.39.xxx.xxx 未訂閱
[Error] Framemain.pas(41): Undeclared identifier: 'WebApplication' 這個 Error 表示您須 uses IWApplication; 另外兩個 Error, 可以的話, 貼出您整個碼 這樣才能知道為什麼錯了.    --- 每個人都是一本書
rainfoot
一般會員


發表:9
回覆:17
積分:5
註冊:2003-05-03

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-05-13 10:53:54 IP:211.92.xxx.xxx 未訂閱
我加了,系统还是法无法识别! 我的例子太乱了!我刚才做了一个小小的例子来解决一下问题!!! 我建了一个1.intaweb /stand alone application/,建立Uformmain。 2.建立一个frame, Uframe。 3。建立application form ,Uformchlid。 4。frame中有链接字,想在frame中设定链接后,可在 formmain直接应用。可是系统编译无法通过!!! 我把自己的小例子的源码赋上,多多指点?!谢谢!!! unit Uframe; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, IWControl, IWHTMLControls; type TFrame1 = class(TFrame) IWLink1: TIWLink; procedure IWLink1Click(Sender: TObject); private procedure Move(AFormClass: TIWAppFormClass); { Private declarations } public { Public declarations } end; implementation uses Uformchild; {$R *.dfm} procedure TFrame1.Move(AFormClass: TIWAppFormClass); begin // Release the current form TIWAppForm(WebApplication.ActiveForm).Release; // Create the next form AFormClass.Create(WebApplication).Show; end; procedure TFrame1.IWLink1Click(Sender: TObject); begin move(Tchild); end; end.
hagar
版主


發表:143
回覆:4056
積分:4445
註冊:2002-04-14

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-05-13 11:29:44 IP:202.39.xxx.xxx 未訂閱
unit Uframe;
   
interface
   
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, IWControl, IWHTMLControls;
   
type
  TFrame1 = class(TFrame)
    IWLink1: TIWLink;
    procedure IWLink1Click(Sender: TObject);
  private
     procedure Move(AFormClass: TIWAppFormClass);
    { Private declarations }
  public
    { Public declarations }
  end;
   
implementation
   
uses Uformchild, IWInit; // 加上 IWInit 這個 unit
   
{$R *.dfm}
   
procedure TFrame1.Move(AFormClass: TIWAppFormClass);
begin
  // Release the current form
  // 把原本的 WebApplication 改成 RWebApplication
  // 至於為什麼, 在 code6421 兄的
  // Building Web Application With Intra Web 的文件中說到
  // WebApplication 與 RWebApplication 是兩個物件
  // 在一般用途上, 儘量使用 RWebApplication
  // 因為 RWebApplication 是個 threadvar 物件
  // 在每個 thread 中都有各自的 RWebApplication
  // 但 WebApplication 則否(哈! 我自己看得是霧煞煞 ...)
  TIWAppForm(RWebApplication.ActiveForm).Release;
  // Create the next form
  AFormClass.Create(RWebApplication).Show;
end;
   
procedure TFrame1.IWLink1Click(Sender: TObject);
begin
  move(Tchild);
end;
   
end.
--- 每個人都是一本書 發表人 - hagar 於 2003/05/13 11:38:49
rainfoot
一般會員


發表:9
回覆:17
積分:5
註冊:2003-05-03

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-05-13 13:49:58 IP:211.92.xxx.xxx 未訂閱
编译通过了,你真是我的偶像!!! 谢谢!虽然很简单,但是很真诚!!!
tonyplus
初階會員


發表:22
回覆:97
積分:28
註冊:2002-04-13

發送簡訊給我
#6 引用回覆 回覆 發表時間:2003-06-20 14:19:24 IP:211.23.xxx.xxx 未訂閱
引言: 编译通过了,你真是我的偶像!!! 谢谢!虽然很简单,但是很真诚!!!
5.1.27版,可得要再改回來'WebApplication' 不然會出現 Undeclared identifier: 'RWebApplication'
系統時間:2024-05-03 22:07:52
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!