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

ActiveForm與HTML交換參數應該用哪種方法

尚未結案
yzml
一般會員


發表:4
回覆:4
積分:1
註冊:2004-12-26

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-12-26 22:36:51 IP:218.91.xxx.xxx 未訂閱
HTML向ActiveX控制項傳送參數有以下幾種方式:    (1)載入時通過Param傳入: 〈object classid="clsid:xxxx-xxxx-xxxx-xxxx-xxxx" id="ActiveX1" width="594" height="401"〉 〈param name="Visible" value="0"〉 〈/object〉 (2)載入後通過函數傳出、傳入: 〈object classid="clsid:xxxx-xxxx-xxxx-xxxx-xxxx" id="ActiveX1" width="594" height="401"〉 傳入 ActiveX1.Visible=0 傳出 CanBeSee=ActiveX1.Visible 在關於DELPHI的有關資料中有多種方式實現參數傳送: (1)在Type Library的pas檔中定義: IYzFTP = interface(IDispatch) ['{D0B55322-B569-4A7E-B256-AEB5B1EC2828}'] function Get_ServerName: WideString; safecall; procedure Set_ServerName(const Value: WideString); safecall; property ServerName: WideString read Get_ServerName write Set_ServerName; 在impl的pas檔中定義: type TYzFTP = class(TActiveForm, IYzFTP) …… protected function Get_ServerName: WideString; safecall; procedure Set_ServerName( Value:WideString); safecall; ……. end; implementation …… function TYzFTP.Get_ServerName: WideString; begin Result := WideString(ServerName); end; procedure TYzFTP.Set_ServerName(const Value: WideString); begin ServerName := Value; end; (2)在Type Library的pas檔中定義: TYzFTP = class(TOleControl) …… published property ServerName: WideString index 201 read GetWideStringProp write SetWideStringProp stored False; …… end; 但GetWideStringProp、SetWideStringProp是幹什麼用的?應該如何實現?與Get_ServerName和Set_ServerName是什麼關係? (3)在Impl的pas檔中定義,如: TActiveFormNewX = class(TActiveFormX,IPersistPropertyBag) public ServerName:String; protected function IPersistPropertyBag.Load =PersistPropertyBagLoad; end; function TActiveFormNewX.PersistPropertyBagLoad(const pPropBag:IPropertyBag; Const pErrorLog:IErrorLog):HResult;stdCall; var Str:OleVariant; begin if pPropBag.Read('ServerName', Str ,pErrorLog) = S_OK then ServerName :=Str; Result:=S_OK; end; 請問這幾種方法的關係、適用場合?如何為某些屬性分配預設值,既既不通過〈param name='XXXX' value='YYYY' 〉也不通過ActiveX1.XXX=YYY 給屬性XXX賦值時,XXX有個原始的預設值?
ddy
站務副站長


發表:262
回覆:2105
積分:1169
註冊:2002-07-13

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-12-27 10:50:34 IP:202.145.xxx.xxx 未訂閱
本帖內容與與Borland相關產品技術問題,僅限產品安裝/BUG/升級的問題無關 故本帖刪除!!    
系統時間:2024-05-03 9:53:01
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!