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

作者: asdfg1597860 (Jay)   2018-09-26 11:53:35
開發平台(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):
作者: ketrobo (貓蘿蔔)   2018-09-29 02:35:00
bool 換成 BOOL 試試

Links booklink

Contact Us: admin [ a t ] ucptt.com