呼叫unit procedure的問題 |
|
demo
一般會員 發表:14 回覆:14 積分:5 註冊:2003-01-13 發送簡訊給我 |
各位大大您好: 我想要在form1->unit1中要去呼叫unit2的procedure abc
(unit2是->file/new/unit來的)
且我在unit1中己經有uses unit2進來了
但在complie時出現error:invalid typecast的訊息..不知道為何會這樣
能否請各位大大幫幫忙....感恩丫
附加檔案:54551_uses unit.zip
|
richtop
資深會員 發表:122 回覆:646 積分:468 註冊:2003-06-10 發送簡訊給我 |
demo 您好: 測試的結果發現,雖然您有uese Unit2,但在Unit2中並沒有將procedure abc(.)在Interface中宣告,這樣當外部引用時,會"看不到"該procedure。
<>
< class="code">unit Unit2; interface uses Dialogs; procedure abc(a:WideString); // 在Interface中加上這行! implementation procedure abc(a:WideString);
begin
showmessage(a);
end; end. RichTop 敬上 =====*****
把數學當工具,可以解決問題;將數學變能力,能夠發現並解決問題!
=====#####
|
demo
一般會員 發表:14 回覆:14 積分:5 註冊:2003-01-13 發送簡訊給我 |
RichTop大大您好:
真是太感謝您了..原來是還要在宣告一次...
呵呵.真是太happy了!!!!謝謝!!
引言: demo 您好: 測試的結果發現,雖然您有uese Unit2,但在Unit2中並沒有將procedure abc(.)在Interface中宣告,這樣當外部引用時,會"看不到"該procedure。 <> < class="code">unit Unit2; interface uses Dialogs; procedure abc(a:WideString); // 在Interface中加上這行! implementation procedure abc(a:WideString); begin showmessage(a); end; end. RichTop 敬上 =====***** 把數學當工具,可以解決問題;將數學變能力,能夠發現並解決問題! =====##### |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |