المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Code Executed Twice - OnHScroll()



C++ Programming
06-06-2012, 12:40 PM
hello guys... I have these two track bars on my form. Now even though I check which tracked bar was clicked; it still executes the code twice which is very awkward. Here is what I am trying

void CMainDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar){ if((CSliderCtrl*)pScrollBar == &m_trackONE) { // some code here // if clicked this one; it starts all over again and reaches here again } if((CSliderCtrl*)pScrollBar == &m_trackTWO) { // some code here // if clicked this one; it starts all over again and reaches here again }}It correctly recognizes which track bar I clicked but why does it starts executing all over again? thanks for any pointer.

This world is going to explode due to international politics, SOON.