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

要如何將應用程式轉為ActiveX Form

缺席
BOSS
中階會員


發表:70
回覆:79
積分:64
註冊:2006-11-01

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-05-20 17:51:23 IP:211.76.xxx.xxx 未訂閱
請問各位前輩 要如何將應用程式轉為ActiveX Form 我參考李維所說先建立ActiveX form,然後再將原本應用程式pas檔加入, 經過分發後我在本機可在IE瀏覽,但是我經由別台電腦連線時卻出現 an erorr occurred while attempting the borland database engine(error $2108)請問要如何解決呢
hagar
版主


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

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-05-20 18:02:13 IP:202.39.xxx.xxx 未訂閱
參考: http://pweb.netcom.com/~cherrman/cvtforms.htm     Converting a standard Delphi Form to an ActiveForm     By Conrad Herrmann, 25 July 1997     People ask me this question often, and there are several techniques that can do this. The technique that I prefer is easy to learn and the most flexible. In this technique, you make your existing Delphi form a child window of an otherwise ActiveForm. Because it’s a child form, you’ll have to add code to set some of its properties to reflect that fact—to remove the window frame, to align it to its parent’s client area, etc.     This approach has several advantages. The first advantage is that its easy to get up and running—the only thing you need to do that’s not already done for you is to add code to create and embed your form in the ActiveForm. Another advantage is that unlike copying your code to the ActiveForm’s implementation file, this approach doesn’t change your form’s implementation at all. The code you’re familiar with is still familiar. It also means the form’s implementation unit can still be included in a regular Delphi application if you so desire.     Steps to convert a Delphi form to an ActiveForm:      Create a blank ActiveForm. In the form’s property inspector, add an Create handler like the one shown below: 
Procedure TActiveForm1.FormCreate(Sender: TObject); 
begin 
  // This code creates a child form that is just a normal 
  // Delphi TForm. 
  // This allows the form to be shown both as a normal 
  // VCL form and as an ActiveForm. 
  ChildForm := TForm1.Create( Self ); 
  ChildForm.Parent := Self; 
  ChildForm.Align := alClient; 
  ChildForm.BorderStyle := bsNone; 
  ChildForm.Visible := True; 
end; 
In the uses clause, add a reference to your form’s unit (in this case, Unit1). Add the form’s implementation unit to the project (in this case, Unit1.pas). Add the declaration of ChildForm to your TActiveForm1 class, like this:
type 
  TActiveForm1 = class ... 
    .... 
  public 
    ChildForm: TForm1; 
    .... 
  end; 
Compile and test your form. --- 每個人都是一本書
hagar
版主


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

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-05-20 18:13:15 IP:202.39.xxx.xxx 未訂閱
搞錯了! 那個錯誤訊息應該是沒安裝 BDE 的關係吧!    --- 每個人都是一本書
wnhoo
高階會員


發表:75
回覆:443
積分:198
註冊:2003-04-22

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-05-20 18:19:51 IP:61.155.xxx.xxx 未訂閱
对于数据库部分,不能直接加在ACTIVEX FROM部分。    你需要建立一个单独的APPLICATION数据服务工具,用来响应ACTIVEX FORM 的请求;因为你的ACTIVEX是要分发到各个客户段的。    供参考!    风花雪月 e梦情缘
------
风花雪月 e梦情缘
BOSS
中階會員


發表:70
回覆:79
積分:64
註冊:2006-11-01

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-05-20 21:56:23 IP:211.76.xxx.xxx 未訂閱
版主你好 你所說的程式碼我都有寫, 可是當clent端透過ie要瀏覽程式時就是會出現那錯誤訊息, 我總不能都在client端都安裝BDE吧, 難道像wnhoo兄所說一定要透過三層架構才能做到嗎? 那我不就要將整個應用程式改寫成3-tier, 真的沒有其他的方法可解決嗎
Justmade
版主


發表:94
回覆:1934
積分:2030
註冊:2003-03-12

發送簡訊給我
#6 引用回覆 回覆 發表時間:2003-05-20 22:17:55 IP:218.16.xxx.xxx 未訂閱
用 ActiveX Form 來做 BDE Database 是應如 wnhoo 兄所說的要使用三層的。 若你用那些 internet 可直接連到的數據庫還可以使用兩層但其實也不安全因數據庫直接開放出 internet。
系統時間:2024-03-29 22:08:43
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!