![]() ![]() Instead, you want to put this value in a string during the MFC's DDX exchange. You are getting an error because the window is closed after DoModal() returns, and GetWindowTextA is a generic function that gets the text from the window handle. Please update your answer thus I could mark it as solution. So your thought about getting text while dialog are not closed yet was right. This->inFileCtrl.GetWindowText(this->inFileString) ON_EN_CHANGE(IDC_MFCEDITBROWSE1, &SpecifyInputDialog::OnEnChangeMfceditbrowse1)Īnd in handler method: void SpecifyInputDialog::OnEnChangeMfceditbrowse1() I managed to get path text by implementing callback BEGIN_MESSAGE_MAP(SpecifyInputDialog, CDialogEx) I will try to get text while dialog not dissmissed. Results in "Debug Assertion Failed" error on last line. Update: here is my code SpecifyInputDialog dlg // this is my dialog inherited from CDialogExĭlg.inFileCtrl.GetWindowTextA(strText.GetBuffer(), 500) // inFileCtrl is CMFCEditBrowseCtrl object After user specifies files on these controls, how to get file paths from these controls? I have dialog with 2 CMFCEditBrowseCtrl controls. Tab characters are displayed as vertical bar (|) characters.I'm working on MFC win32 project. The SetWindowText function does not expand tab characters (ASCII code 0x09). To set the text of a control in another process, send the WM_SETTEXT message directly instead of calling SetWindowText. If the control is a list box control created with the WS_CAPTION style, however, SetWindowText sets the text for the control, not for the list box entries. If the target window is owned by the current process, SetWindowText causes a WM_SETTEXT message to be sent to the specified window or control. To get extended error information, call GetLastError. If the function fails, the return value is zero. If the function succeeds, the return value is nonzero. ![]() Syntax BOOL SetWindowTextW(Ī handle to the window or control whose text is to be changed. However, SetWindowText cannot change the text of a control in another application. If the specified window is a control, the text of the control is changed. Changes the text of the specified window's title bar (if it has one). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |