Click here to Skip to main content
15,888,454 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: which one would be better? Pin
leon de boer11-Jul-17 5:50
leon de boer11-Jul-17 5:50 
AnswerRe: which one would be better? Pin
bestbear11-Jul-17 17:18
bestbear11-Jul-17 17:18 
Questionwhich one would be better? Pin
bestbear11-Jul-17 1:18
bestbear11-Jul-17 1:18 
Questionquestions plz solve throught c or c++ Pin
Member 1330375110-Jul-17 22:51
Member 1330375110-Jul-17 22:51 
AnswerRe: questions plz solve throught c or c++ Pin
CodeWraith10-Jul-17 23:21
CodeWraith10-Jul-17 23:21 
AnswerRe: questions plz solve throught c or c++ Pin
Richard MacCutchan11-Jul-17 0:21
mveRichard MacCutchan11-Jul-17 0:21 
AnswerRe: questions plz solve throught c or c++ Pin
Patrice T16-Jul-17 17:34
mvePatrice T16-Jul-17 17:34 
QuestionHow to save the filename retrieved from a dialog class using CMFCEditBrowseCtrl? Pin
lolici10-Jul-17 8:07
lolici10-Jul-17 8:07 
Hello! I'm trying to browse a text file using CMFCEditBrowseCtrl (it is used in CFirstDialog Class) and use this file in another Dialog Class (named CSecondDialog Class). My problem is on how to save the filename retrieved from the CMFCEditBrowseCtrl when the CFirstDialog::OnEnChangeMfceditbrowse1() goes out of scope and then pass the filename to the CSecondDialog. Here is the code:

void CFirstDialog::OnEnChangeMfceditbrowse1()
{
        CString str;
	m_browser.GetWindowText(str); //CMFCEditBrowseCtrl m_browser (variable)
}


void CSecondDialog::OnBnClickedOk()
{
CStdioFile fileSource("here I need to put the filename retrieved from the previous dialog class", CFile::modeRead);
CStdioFile fileDest;
CString strLine;
CString strFile;
int num = 1;

while (fileSource.ReadString(strLine))
{
	strFile.Format(L"over%d.txt", num++);
	fileDest.Open(strFile, CFile::modeWrite);
	fileDest.WriteString(strLine);
	fileDest.Close();
}

fileSource.Close();

}

AnswerRe: How to save the filename retrieved from a dialog class using CMFCEditBrowseCtrl? Pin
Richard MacCutchan10-Jul-17 21:28
mveRichard MacCutchan10-Jul-17 21:28 
AnswerRe: How to save the filename retrieved from a dialog class using CMFCEditBrowseCtrl? Pin
Jochen Arndt10-Jul-17 21:38
professionalJochen Arndt10-Jul-17 21:38 
GeneralRe: How to save the filename retrieved from a dialog class using CMFCEditBrowseCtrl? Pin
lolici11-Jul-17 8:33
lolici11-Jul-17 8:33 
GeneralRe: How to save the filename retrieved from a dialog class using CMFCEditBrowseCtrl? Pin
Jochen Arndt11-Jul-17 9:08
professionalJochen Arndt11-Jul-17 9:08 
GeneralRe: How to save the filename retrieved from a dialog class using CMFCEditBrowseCtrl? Pin
lolici11-Jul-17 9:18
lolici11-Jul-17 9:18 
GeneralRe: How to save the filename retrieved from a dialog class using CMFCEditBrowseCtrl? Pin
lolici15-Jul-17 3:53
lolici15-Jul-17 3:53 
GeneralRe: How to save the filename retrieved from a dialog class using CMFCEditBrowseCtrl? Pin
Jochen Arndt15-Jul-17 22:00
professionalJochen Arndt15-Jul-17 22:00 
QuestionProblem in precedence of operators. Pin
parkavikkk7-Jul-17 21:25
parkavikkk7-Jul-17 21:25 
AnswerRe: Problem in precedence of operators. Pin
Richard MacCutchan7-Jul-17 22:02
mveRichard MacCutchan7-Jul-17 22:02 
GeneralRe: Problem in precedence of operators. Pin
parkavikkk7-Jul-17 22:30
parkavikkk7-Jul-17 22:30 
AnswerRe: Problem in precedence of operators. Pin
Jochen Arndt7-Jul-17 22:15
professionalJochen Arndt7-Jul-17 22:15 
AnswerRe: Problem in precedence of operators. Pin
Victor Nijegorodov8-Jul-17 11:13
Victor Nijegorodov8-Jul-17 11:13 
GeneralRe: Problem in precedence of operators. Pin
jschell10-Jul-17 4:33
jschell10-Jul-17 4:33 
Questionwhat is pla.h ? Pin
Flaze077-Jul-17 6:45
Flaze077-Jul-17 6:45 
AnswerRe: what is pla.h ? Pin
jeron17-Jul-17 7:20
jeron17-Jul-17 7:20 
AnswerRe: what is pla.h ? Pin
David Crow7-Jul-17 7:25
David Crow7-Jul-17 7:25 
GeneralRe: what is pla.h ? Pin
Flaze078-Jul-17 16:16
Flaze078-Jul-17 16:16 

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.