如何只需一次安裝程序便將數個元件安裝完畢 |
答題得分者是:william
|
bruce0211
版主 發表:157 回覆:668 積分:279 註冊:2002-06-13 發送簡訊給我 |
|
william
版主 發表:66 回覆:2535 積分:3048 註冊:2002-07-11 發送簡訊給我 |
|
bruce0211
版主 發表:157 回覆:668 積分:279 註冊:2002-06-13 發送簡訊給我 |
Sir
如果我將 TMyStringGrid 中寫下 RegisterComponents('MyWay',[TMyStringGrid,TMyIni]);
TMyStringGrid 怎知 TMyini 是誰 ?? TMyStringGrid.pas 中只有 TMyStringGrid 元件的程式碼
TMyIni.pas 中只有 TMyIni 元件的程式碼
我覺得是否要外部再寫一統籌各元件的"總"註冊程序 ??
您的意思是否要我再寫一個"空"的 TMyWay 元件
裡面只有註冊 TMyStringGrid,TMyIni 的程序
我試過,下列程式碼是可用,但合乎正統方式嗎(我真的不知道,只有自己Try)
只為了幫別人註冊,會不會多出一個無用的 TMyWay 類別(class)
unit MyWay; interface uses SysUtils, Classes, MyStringGrid,MyIni; type TMyWay = class(TComponent) private { Private declarations } protected { Protected declarations } public { Public declarations } published { Published declarations } end; procedure Register; implementation procedure Register; begin RegisterComponents('MyWay',[TMyStringGrid,TMyIni]); end; end.發表人 - bruce0211 於 2003/11/06 12:37:33 |
japhenchen
高階會員 發表:51 回覆:444 積分:184 註冊:2003-07-23 發送簡訊給我 |
|
bruce0211
版主 發表:157 回覆:668 積分:279 註冊:2002-06-13 發送簡訊給我 |
|
william
版主 發表:66 回覆:2535 積分:3048 註冊:2002-07-11 發送簡訊給我 |
unit MyWay; interface uses SysUtils, Classes, MyStringGrid,MyIni; procedure Register; implementation procedure Register; begin RegisterComponents('MyWay',[TMyStringGrid,TMyIni]); end; end.Well... a common way is to create an unit to register the class as you tried before. And there is no need to define any class in the unit. |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |