[問題] 轉型成Object以後...
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
Visual studio 2010
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
NO
問題(Question):
將原本的類別轉型成Object檔案後 無法呼叫原先類別中的method
餵入的資料(Input):
預期的正確結果(Expected Output):
可以呼叫到原本的method
錯誤結果(Wrong Output):
error C2039 : 'set' :不是'System::Object'的成員
程式碼(Code):(請善用置底文網頁, 記得排版)
void detect(Object^f1)
{
// set為原本Form1中的一個方法 這次的問題是希望能夠重新呼叫道set
f1->set(10);
}
int main()
{
Form1 ^f1 = gcnew Form1();
Thread ^dt = gcnew Thread(gcnew ParameterizedThreadStart(&detect));
dt->Start(f1);
// 如果將set放在此 不會有錯誤
//f1->set(10);
}
麻煩各位大大了(鞠躬
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 192.192.199.49
→
11/17 01:26, , 1F
11/17 01:26, 1F
→
11/17 01:31, , 2F
11/17 01:31, 2F
→
11/17 10:19, , 3F
11/17 10:19, 3F
→
11/17 10:21, , 4F
11/17 10:21, 4F
→
11/17 10:22, , 5F
11/17 10:22, 5F