[問題] MFC 類別中宣告變數遇到溢位

看板C_and_CPP (C/C++)作者 (Jay)時間7年前 (2018/09/26 11:53), 7年前編輯推噓0(001)
留言1則, 1人參與, 7年前最新討論串1/1
開發平台(Platform): (Ex: Win10, Linux, ...) WIN10 編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出) VS2017 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 問題(Question): 各位前輩好,目前小弟我在操作一個MFC的專案 想把專案升級到VS2017 不過這個專案只跑Release模式 所以偵錯主要透過黑視窗 目前我發現當我加入CStaticBitmap時(繼承CStatic) 會導致m_nSelect(int型別) 的記憶體位置跑掉 不知道前輩之前有沒有遇到這個問題 餵入的資料(Input): 預期的正確結果(Expected Output): 錯誤結果(Wrong Output): https://imgur.com/a/StJDeJk 宣告StaticPhoto物件時m_nSelect記憶體位址 https://imgur.com/a/kJ4DeNT 宣告StaticBitmap物件時m_nSelect記憶體位址 程式碼(Code):(請善用置底文網頁, 記得排版,禁止使用圖檔) StaticBitmap 的程式碼 https://imgur.com/a/zAWCvYZ 補充說明(Supplement): -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 59.127.200.146 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1537934017.A.A4F.html

09/29 02:35, 7年前 , 1F
bool 換成 BOOL 試試
09/29 02:35, 1F
前輩我嘗試後的結果一樣 謝謝前輩建議 ※ 編輯: asdfg1597860 (59.127.200.146), 10/01/2018 17:09:44
文章代碼(AID): #1RgmB1fF (C_and_CPP)
文章代碼(AID): #1RgmB1fF (C_and_CPP)