Problem in Getting Handle of EditBox.
-
Hi Friends, I have difficulties in getting handle of EditBox when I get the value of edit box. Following code is execute correctly when i set value to edit box CEdit *pOpenEdit = (CEdit *) GetDlgItem(IDC_FOLDER_PATH); if( NULL != pOpenEdit->GetSafeHwnd() ) { if( strOpenPath != "" ) pOpenEdit->SetWindowText(strOpenPath); } But when I want to get value of edit box , i did not get the handle of edit box. so it did not entered in if Block. CEdit *pOpenEdit = (CEdit *)GetDlgItem(IDC_FOLDER_PATH); if( NULL != pOpenEdit->GetSafeHwnd() ) { char buff[500]; pOpenEdit->GetWindowText(buff,256); strOpenLocation = buff; } So please let me know what is wrong in this code. Thanks in Advance Atul
-
Hi Friends, I have difficulties in getting handle of EditBox when I get the value of edit box. Following code is execute correctly when i set value to edit box CEdit *pOpenEdit = (CEdit *) GetDlgItem(IDC_FOLDER_PATH); if( NULL != pOpenEdit->GetSafeHwnd() ) { if( strOpenPath != "" ) pOpenEdit->SetWindowText(strOpenPath); } But when I want to get value of edit box , i did not get the handle of edit box. so it did not entered in if Block. CEdit *pOpenEdit = (CEdit *)GetDlgItem(IDC_FOLDER_PATH); if( NULL != pOpenEdit->GetSafeHwnd() ) { char buff[500]; pOpenEdit->GetWindowText(buff,256); strOpenLocation = buff; } So please let me know what is wrong in this code. Thanks in Advance Atul
Your error is not in the block of code you are showing me. I would assume that at the time that you are "getting" the value -- your dialog has been closed... When are you calling this "get"?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [SoonR Inc -- PC Power delivered to your phone](http://www.soonr.com)
-
Hi Friends, I have difficulties in getting handle of EditBox when I get the value of edit box. Following code is execute correctly when i set value to edit box CEdit *pOpenEdit = (CEdit *) GetDlgItem(IDC_FOLDER_PATH); if( NULL != pOpenEdit->GetSafeHwnd() ) { if( strOpenPath != "" ) pOpenEdit->SetWindowText(strOpenPath); } But when I want to get value of edit box , i did not get the handle of edit box. so it did not entered in if Block. CEdit *pOpenEdit = (CEdit *)GetDlgItem(IDC_FOLDER_PATH); if( NULL != pOpenEdit->GetSafeHwnd() ) { char buff[500]; pOpenEdit->GetWindowText(buff,256); strOpenLocation = buff; } So please let me know what is wrong in this code. Thanks in Advance Atul
How did you create it?