[問題] 類

看板C_and_CPP作者 (平凡)時間9年前發表 (2016/01/04 14:49), 9年前編輯推噓2(202)
留言4則, 3人參與, 最新討論串1/1
開發平台(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): -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.251.227.30 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1451918983.A.DB9.html ※ 編輯: GooLoo (111.251.227.30), 01/04/2016 22:49:55 ※ 編輯: GooLoo (111.251.227.30), 01/04/2016 22:50:41

01/04 23:02, , 1F
GetDlgItem
01/04 23:02, 1F

01/05 10:30, , 2F
雖然VC6是一代經典 但是 他已經過時了 建議換到2015吧
01/05 10:30, 2F

01/05 10:31, , 3F
反正現在都有免費版 除了你有什麼歷史的包袱之類的
01/05 10:31, 3F

01/05 21:15, , 4F
原來是I看成L,感謝
01/05 21:15, 4F
文章代碼(AID): #1MYeQ7sv (C_and_CPP)