Click here to Skip to main content
15,914,165 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: listen on port 135 Pin
Dennis C. Dietrich15-Nov-04 8:57
Dennis C. Dietrich15-Nov-04 8:57 
GeneralRe: listen on port 135 Pin
Anonymous16-Nov-04 7:00
Anonymous16-Nov-04 7:00 
QuestionHow to use Chars in a CString ? Pin
Master^Tristar14-Nov-04 6:38
Master^Tristar14-Nov-04 6:38 
AnswerRe: How to use Chars in a CString ? Pin
John R. Shaw14-Nov-04 8:31
John R. Shaw14-Nov-04 8:31 
GeneralI need someone to make me a program plz Pin
Member 151788014-Nov-04 5:38
Member 151788014-Nov-04 5:38 
GeneralRe: I need someone to make me a program plz Pin
John R. Shaw14-Nov-04 8:36
John R. Shaw14-Nov-04 8:36 
GeneralRe: I need someone to make me a program plz Pin
ThatsAlok14-Nov-04 22:38
ThatsAlok14-Nov-04 22:38 
GeneralPassing data from a Modal Dialog back to the Dialog that created it Pin
dlarkin7714-Nov-04 4:34
dlarkin7714-Nov-04 4:34 
Hi,

Can anyone please help me with this problem?

I have a dialog with a CRichEditCtrl and a button.
The user highlights a piece of text and clicks the button.
When the button is clicked, a modal Dialog is created.
This modal dialog has a CEdit and a button. The CEdit contains a variable of type CString.
The user enters text in this CEdit.
When the OK button is clicked, the text in the CEdit should replace the highlighted text in the CRichEditCtrl in the initial dialog.

When the program is executed it gives a "Debug Assertion Failed" error.
The assertion is as follows (from AFXCMN.H):
<br />
AFXCMN_INLINE void CRichEditCtrl::ReplaceSel(LPCTSTR lpszNewText, BOOL bCanUndo)<br />
	{ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_REPLACESEL, (WPARAM) bCanUndo, (LPARAM)lpszNewText); }<br />


My code is as follows:

<br />
void MyModalDialog::OnBtnOk() <br />
{<br />
	CString returnStr = m_edit;	// m_edit is the CString variable atached to the CEdit<br />
	MyProjectDlg dlg;		// the initial dialog is of class MyProjectDlg<br />
	dlg.m_fileContents.ReplaceSel(returnStr, FALSE);	// m_fileContents is the name of the CRichEditCtrl	<br />
}<br />


Thanks very much,

dlarkin77 Confused | :confused:
GeneralRe: Passing data from a Modal Dialog back to the Dialog that created it Pin
John R. Shaw14-Nov-04 9:00
John R. Shaw14-Nov-04 9:00 
GeneralRe: Passing data from a Modal Dialog back to the Dialog that created it Pin
dlarkin7714-Nov-04 22:58
dlarkin7714-Nov-04 22:58 
QuestionHow to search a File in the Hard Disk using C++? Pin
pubududilena14-Nov-04 3:31
pubududilena14-Nov-04 3:31 
AnswerRe: How to search a File in the Hard Disk using C++? Pin
Maximilien14-Nov-04 4:32
Maximilien14-Nov-04 4:32 
AnswerRe: How to search a File in the Hard Disk using C++? Pin
John R. Shaw14-Nov-04 9:20
John R. Shaw14-Nov-04 9:20 
GeneralRe: How to search a File in the Hard Disk using C++? Pin
pubududilena14-Nov-04 12:18
pubududilena14-Nov-04 12:18 
QuestionHow to run exe file using C++? Pin
pubududilena14-Nov-04 3:26
pubududilena14-Nov-04 3:26 
AnswerRe: How to run exe file using C++? Pin
Michael Dunn14-Nov-04 4:50
sitebuilderMichael Dunn14-Nov-04 4:50 
AnswerRe: How to run exe file using C++? Pin
ThatsAlok14-Nov-04 18:32
ThatsAlok14-Nov-04 18:32 
GeneralCAsyncMonikerFile Pin
PetoG14-Nov-04 1:31
PetoG14-Nov-04 1:31 
GeneralRe: CAsyncMonikerFile Pin
John R. Shaw14-Nov-04 10:03
John R. Shaw14-Nov-04 10:03 
GeneralRe: CAsyncMonikerFile Pin
PetoG15-Nov-04 4:58
PetoG15-Nov-04 4:58 
QuestionHelp!!! How to change Cursor Permanent ??? Pin
VikramDelhi13-Nov-04 23:29
VikramDelhi13-Nov-04 23:29 
AnswerRe: Help!!! How to change Cursor Permanent ??? Pin
Jack Puppy14-Nov-04 1:19
Jack Puppy14-Nov-04 1:19 
GeneralRe: Help!!! How to change Cursor Permanent ??? Pin
John R. Shaw14-Nov-04 9:33
John R. Shaw14-Nov-04 9:33 
GeneralRe: Help!!! How to change Cursor Permanent ??? Pin
gamitech15-Nov-04 19:54
gamitech15-Nov-04 19:54 
GeneralRe: Help!!! How to change Cursor Permanent ??? Pin
VikramDelhi16-Nov-04 8:41
VikramDelhi16-Nov-04 8:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.