全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:993
推到 Plurk!
推到 Facebook!

為何我寫的多執行緒無法compile

答題得分者是:RaynorPao
csm825050
一般會員


發表:49
回覆:29
積分:15
註冊:2003-08-20

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-08-29 17:07:10 IP:61.30.xxx.xxx 未訂閱
可以幫我看看錯在哪嗎    <<>> #include #pragma hdrstop #include "Unit1.h" #include "Unit2.h" #include "Unit3.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::FormCreate(TObject *Sender) { BarInc = new TBarInc(false); <--這行一直過不了 BarDec = new TBarDec(true); <-- } //--------------------------------------------------------------------------- <<>> //--------------------------------------------------------------------------- #ifndef Unit1H #define Unit1H //--------------------------------------------------------------------------- #include #include #include #include <Forms.hpp> #include //--------------------------------------------------------------------------- class TForm1 : public TForm { __published: // IDE-managed Components TButton *Button1; TButton *Button2; TButton *Button3; TButton *Button4; TProgressBar *ProgressBar1; void __fastcall FormCreate(TObject *Sender); void __fastcall Button1Click(TObject *Sender); void __fastcall Button2Click(TObject *Sender); void __fastcall Button3Click(TObject *Sender); void __fastcall Button4Click(TObject *Sender); private: // User declarations TThread *BarInc; TThread *BarDec; public: // User declarations __fastcall TForm1(TComponent* Owner); }; //--------------------------------------------------------------------------- extern PACKAGE TForm1 *Form1; //--------------------------------------------------------------------------- #endif 出現的錯誤訊息 [C Error] Unit1.cpp(22): E2303 Type name expected [C Error] Unit1.cpp(22): E2034 Cannot convert 'int *' to 'TThread *' [C Error] Unit1.cpp(22): E2379 Statement missing ;
RaynorPao
版主


發表:139
回覆:3622
積分:7025
註冊:2002-08-12

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-08-29 17:26:33 IP:203.73.xxx.xxx 未訂閱
引言: 可以幫我看看錯在哪嗎 <<>> #include #pragma hdrstop #include "Unit1.h" #include "Unit2.h" #include "Unit3.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::FormCreate(TObject *Sender) { BarInc = new TBarInc(false); <--這行一直過不了 BarDec = new TBarDec(true); <-- } //--------------------------------------------------------------------------- <<>> //--------------------------------------------------------------------------- #ifndef Unit1H #define Unit1H //--------------------------------------------------------------------------- #include #include #include #include <Forms.hpp> #include //--------------------------------------------------------------------------- class TForm1 : public TForm { __published: // IDE-managed Components TButton *Button1; TButton *Button2; TButton *Button3; TButton *Button4; TProgressBar *ProgressBar1; void __fastcall FormCreate(TObject *Sender); void __fastcall Button1Click(TObject *Sender); void __fastcall Button2Click(TObject *Sender); void __fastcall Button3Click(TObject *Sender); void __fastcall Button4Click(TObject *Sender); private: // User declarations TThread *BarInc; TThread *BarDec; public: // User declarations __fastcall TForm1(TComponent* Owner); }; //--------------------------------------------------------------------------- extern PACKAGE TForm1 *Form1; //--------------------------------------------------------------------------- #endif 出現的錯誤訊息 [C Error] Unit1.cpp(22): E2303 Type name expected [C Error] Unit1.cpp(22): E2034 Cannot convert 'int *' to 'TThread *' [C Error] Unit1.cpp(22): E2379 Statement missing ;
csm825050 你好: 請參考以下的連結文章 (下次記得多利用本站的搜尋功能喔)
------
-- 若您已經得到滿意的答覆,請適時結案!! --
-- 欲知前世因,今生受者是;欲知來世果,今生做者是 --
-- 一切有為法,如夢幻泡影,如露亦如電,應作如是觀 --
csm825050
一般會員


發表:49
回覆:29
積分:15
註冊:2003-08-20

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-08-29 17:30:26 IP:61.30.xxx.xxx 未訂閱
謝謝 看來是腦袋不靈光了
系統時間:2024-11-25 11:43:45
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!