![]() |
GetEditCtrl()->GetWindowText crash |
Post Reply ![]() |
Author | |
mathewteena ![]() Newbie ![]() ![]() Joined: 26 December 2013 Location: India Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() Posted: 26 December 2013 at 1:29pm |
Code snippet is as below:
CXTPControls* pXTPControls = m_myWndToolBar.GetControls(); if (!pXTPControls ) return false; CXTPControlComboBox* pXTPComboBox =(CXTPControlComboBox*)pXTPControls ->FindControl(ID_ZOOM); if (!pXTPComboBox ) return false; CString strZoom; pXTPComboBox ->GetEditCtrl()->GetWindowText(strZoom); The line in the snippet that has been marked as bold causes a crash. I suspect that GetEditCtrl returns NULL( or invalid pointer) which leads to GetWindowText() to crash. What could be the possible reasons for GetEditCtrl returning invalid pointer?
|
|
![]() |
|
kstowell ![]() Admin Group ![]() Joined: 25 January 2003 Location: MIchigan, USA Status: Offline Points: 496 |
![]() ![]() ![]() ![]() ![]() |
It could be that the combo box is a drop list in that case it would not have an edit control. You might want to try something like this:
|
|
Kirk Stowell, President and CEO
CODEJOCK SOFTWARE SOLUTIONS< |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |