Hey people. I'm cutting my teeth with MFC Dialog windows. Currently, I'm trying to have a edit box grow to the right, and move a label for that edit box to match. To this end I have a CEdit object m_ViewPulseCtrl, and a CStatic object m_PulseTotalCtrl. here's the code:
Code:
int pulseDigits = 32;
CRect * calcR = new CRect();
m_ViewPulseCtrl.GetWindowRect(calcR);
m_ViewPulseCtrl.SetWindowPos (NULL, 0, 0, pulseDigits , calcR->bottom - calcR->top, SWP_NOZORDER | SWP_NOMOVE);
m_PulseTotalCtrl.GetWindowRect(calcR);
m_PulseTotalCtrl.SetWindowPos (NULL, calcR->left + pulseDigits , calcR->top, 0, 0, SWP_NOZORDER | SWP_NOSIZE );
m_PulseTotalCtrl.GetWindowRect(calcR);
Now, the edit box resizes correctly, but the CStatic object flies off into lala land. I tracked the value of calcR in the debugger and got this:
Code:
line 4: calcR{top=513 bottom=536 left=218 right=247}
line 6: calcR{top=620 bottom=633 left=380 right=449}
what am I doing wrong?