我想繼承使用此代碼在對話框中的進度控制:WTL和CContainedWindow導致訪問衝突
ATL::CContainedWindowT<WTL::CProgressBarCtrl> progress;
// ...
progress.SubclassWindow(GetDlgItem(IDC_PROGRESS));
都好那裏。現在,如果我嘗試這樣做:
progress.SetRange(0, 100);
我得到的訪問衝突異常的SendMessage
在平凡的WTL的SetRange()
實現。我一直在尋找上下,我能找到的所有這些都可能是Applications Using Older ATL Components May Experience Conflicts With DEP中提到的一些「thunking」問題,因爲我使用的是最新的ATL和WTL(Visual Studio 2010和WTL 8.1),所以這不應該適用於我。即使使用WTL 8.0,我也會遇到同樣的問題。
由於HWND是有效的,子類別已經完成。有任何想法嗎?
'CProgressBarCtrl'沒有實現'SubclassWindow',所以這是不行的。你可以說得更詳細點嗎? – wpfwannabe
m_Progress.Attach(GetDlgItem(IDC_PROGRESS1)); \t m_Progress.SetPos(0); – johnathon