Click here to Skip to main content
15,915,501 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Converting from Visual C++ 6 to Visual C++.NET Pin
Alvaro Mendez18-Sep-03 9:18
Alvaro Mendez18-Sep-03 9:18 
GeneralRe: Converting from Visual C++ 6 to Visual C++.NET Pin
vinodgs18-Sep-03 10:07
vinodgs18-Sep-03 10:07 
GeneralRe: Converting from Visual C++ 6 to Visual C++.NET Pin
Alvaro Mendez18-Sep-03 10:51
Alvaro Mendez18-Sep-03 10:51 
GeneralMultiple files used for input to SDI Application Pin
b_girl18-Sep-03 8:49
b_girl18-Sep-03 8:49 
GeneralRe: Multiple files used for input to SDI Application Pin
David Crow18-Sep-03 9:03
David Crow18-Sep-03 9:03 
GeneralRe: Multiple files used for input to SDI Application Pin
b_girl18-Sep-03 9:15
b_girl18-Sep-03 9:15 
GeneralRe: Multiple files used for input to SDI Application Pin
Alvaro Mendez18-Sep-03 9:25
Alvaro Mendez18-Sep-03 9:25 
GeneralRe: Multiple files used for input to SDI Application Pin
b_girl18-Sep-03 9:53
b_girl18-Sep-03 9:53 
I'm not displaying any of the file information (as of yet). The files unknown to the user are used mainly for storing output, and reading for input.

Using other files for input/ouput works just fine if the user never "opens" a file. As soon as the user does this, it seems to not create any of the other files required for the output.

In my CMainFrame constructor I have:
CMainFrame::CMainFrame()
{
m_fileName = "inputParams.txt"; //used first for output, later as input
CFile m_filePtr(m_fileName, CFile::modeCreate);
}

Later on, a modeless dialog opens up which first attempts to open m_fileName for reading. It will successfully do this as long as the user has not "opened" a file:
BOOL CSetupModeless::OnInitDialog()
{
CDialog::OnInitDialog();

CFileException e;
CFile paramFilePtr = ((CMainFrame*)m_parent)->m_filePtr;
paramFileName = ((CMainFrame*)m_parent)->m_fileName;

//attempt to open inputParams.txt for reading only
if((paramFilePtr.Open(paramFileName, CFile::modeRead, &e )) == false )
{
//it will only come in here if user "opened" a file first
AfxMessageBox("error");
}
else
{
//it will come in here all the time, until
//the user "opens" a file... this is where it should go!
}
return TRUE;
}

Anyone know what would stop it from entering into the else when the user "opens" a file?
GeneralRe: Multiple files used for input to SDI Application Pin
Alvaro Mendez18-Sep-03 10:47
Alvaro Mendez18-Sep-03 10:47 
GeneralRe: Multiple files used for input to SDI Application Pin
b_girl18-Sep-03 10:51
b_girl18-Sep-03 10:51 
GeneralRe: Multiple files used for input to SDI Application Pin
David Crow19-Sep-03 2:41
David Crow19-Sep-03 2:41 
GeneralRe: Multiple files used for input to SDI Application Pin
b_girl19-Sep-03 3:17
b_girl19-Sep-03 3:17 
GeneralRe: Multiple files used for input to SDI Application Pin
David Crow19-Sep-03 3:54
David Crow19-Sep-03 3:54 
GeneralRe: Multiple files used for input to SDI Application Pin
b_girl19-Sep-03 4:03
b_girl19-Sep-03 4:03 
GeneralRe: Multiple files used for input to SDI Application Pin
David Crow19-Sep-03 4:07
David Crow19-Sep-03 4:07 
GeneralRe: Multiple files used for input to SDI Application Pin
b_girl19-Sep-03 4:11
b_girl19-Sep-03 4:11 
GeneralRe: Multiple files used for input to SDI Application Pin
David Crow19-Sep-03 4:26
David Crow19-Sep-03 4:26 
GeneralRe: Multiple files used for input to SDI Application Pin
b_girl19-Sep-03 4:35
b_girl19-Sep-03 4:35 
GeneralRe: Multiple files used for input to SDI Application Pin
David Crow19-Sep-03 5:52
David Crow19-Sep-03 5:52 
GeneralRe: Multiple files used for input to SDI Application Pin
b_girl19-Sep-03 5:17
b_girl19-Sep-03 5:17 
GeneralRe: Multiple files used for input to SDI Application Pin
David Crow19-Sep-03 6:02
David Crow19-Sep-03 6:02 
GeneralRe: Multiple files used for input to SDI Application Pin
b_girl19-Sep-03 7:38
b_girl19-Sep-03 7:38 
GeneralRe: Multiple files used for input to SDI Application Pin
David Crow19-Sep-03 7:43
David Crow19-Sep-03 7:43 
GeneralRe: Multiple files used for input to SDI Application Pin
b_girl19-Sep-03 8:35
b_girl19-Sep-03 8:35 
GeneralRe: Multiple files used for input to SDI Application Pin
David Crow19-Sep-03 8:39
David Crow19-Sep-03 8:39 

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.