[問題] 類

作者: GooLoo (平凡)   2016-01-04 22:49:41
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
vc++ 6.0
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
初次使用VC, 上網看一些短片,
照上面KEY,先練習怎麼設定Label1的文字.
其中,它提到 Wnd類 給指標Label1,並且取得ID, 就可以調用它的參數設定
可是我照做卻弄不出來
且....CWnd沒出現藍字...
餵入的資料(Input):
預期的正確結果(Expected Output):
IDC_STATIC 的Test出現ABC
錯誤結果(Wrong Output):
error C2065: 'GetDlgitem' : undeclared identifier
error C2440: 'initializing' : cannot convert from 'int' to 'class CWnd *'
Conversion from integral type to pointer type requires reinterpret_cast,
C-style cast or function-style cast
程式碼(Code):(請善用置底文網頁, 記得排版)
void CT02Dlg::OnButton2()
{
CWnd *Label1=GetDlgitem(IDC_STATIC);
Label1->SetWindowText("ABC");
}
補充說明(Supplement):
作者: EdisonX (卡卡獸)   2016-01-04 23:02:00
GetDlgItem
作者: Clangpp (Clang++)   2016-01-05 10:30:00
雖然VC6是一代經典 但是 他已經過時了 建議換到2015吧反正現在都有免費版 除了你有什麼歷史的包袱之類的
作者: GooLoo (平凡)   2016-01-05 21:15:00
原來是I看成L,感謝

Links booklink

Contact Us: admin [ a t ] ucptt.com