Click here to Skip to main content
15,896,154 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help needed in loading file! Pin
cyn817-Apr-07 8:33
cyn817-Apr-07 8:33 
GeneralRe: Help needed in loading file! Pin
Mark Salsbery17-Apr-07 8:37
Mark Salsbery17-Apr-07 8:37 
GeneralRe: Help needed in loading file! Pin
cyn817-Apr-07 8:49
cyn817-Apr-07 8:49 
GeneralRe: Help needed in loading file! Pin
David Crow17-Apr-07 8:54
David Crow17-Apr-07 8:54 
GeneralRe: Help needed in loading file! Pin
cyn817-Apr-07 9:00
cyn817-Apr-07 9:00 
GeneralRe: Help needed in loading file! Pin
David Crow17-Apr-07 10:10
David Crow17-Apr-07 10:10 
GeneralRe: Help needed in loading file! Pin
Mark Salsbery17-Apr-07 12:36
Mark Salsbery17-Apr-07 12:36 
GeneralRe: Help needed in loading file! Pin
Mark Salsbery17-Apr-07 9:00
Mark Salsbery17-Apr-07 9:00 
Besides the potential memory problems that DavidCrow has mentioned...

I'm trying to narrow it down without being able to debug your code

Try this, replacing "c:\\path\\abc.txt" with a fully qualified pathname (drive letter/path/filename)
that you are absolutely sure exists.

The open should succeed. If it still only succeeds when you don't use the fileopen dialog then
you are trashing memory somewhere and you need to fix that code. If it succeeds always then
you have a pathname problem in OnLoad().

void CICTesterDlg::OnLoad()
{
UpdateData();
CString file;
file="c:\\path\\abc.txt";

std::ifstream outputdata;
outputdata.open(file), ios::in);
if ( !outputdata.is_open() )
{
MessageBox(_T("Unable to open file!"),_T("WARNING"),MB_ICONEXCLAMATION);
return;
}
outputdata.close();

}




"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

GeneralRe: Help needed in loading file! Pin
David Crow17-Apr-07 8:01
David Crow17-Apr-07 8:01 
GeneralRe: Help needed in loading file! Pin
Mark Salsbery17-Apr-07 8:28
Mark Salsbery17-Apr-07 8:28 
QuestionRe: Help needed in loading file! Pin
David Crow17-Apr-07 7:58
David Crow17-Apr-07 7:58 
AnswerRe: Help needed in loading file! Pin
cyn817-Apr-07 8:19
cyn817-Apr-07 8:19 
AnswerRe: Help needed in loading file! Pin
David Crow17-Apr-07 8:11
David Crow17-Apr-07 8:11 
GeneralRe: Help needed in loading file! Pin
cyn817-Apr-07 8:29
cyn817-Apr-07 8:29 
GeneralRe: Help needed in loading file! Pin
David Crow17-Apr-07 8:52
David Crow17-Apr-07 8:52 
Question__.dll not found. Re-installing the application... Pin
VonHagNDaz17-Apr-07 5:52
VonHagNDaz17-Apr-07 5:52 
QuestionRe: __.dll not found. Re-installing the application... Pin
David Crow17-Apr-07 5:56
David Crow17-Apr-07 5:56 
AnswerRe: __.dll not found. Re-installing the application... Pin
VonHagNDaz17-Apr-07 5:58
VonHagNDaz17-Apr-07 5:58 
AnswerRe: __.dll not found. Re-installing the application... Pin
Mark Salsbery17-Apr-07 6:38
Mark Salsbery17-Apr-07 6:38 
GeneralRe: __.dll not found. Re-installing the application... Pin
VonHagNDaz17-Apr-07 6:41
VonHagNDaz17-Apr-07 6:41 
GeneralRe: __.dll not found. Re-installing the application... Pin
Mark Salsbery17-Apr-07 6:49
Mark Salsbery17-Apr-07 6:49 
GeneralRe: __.dll not found. Re-installing the application... Pin
VonHagNDaz17-Apr-07 8:02
VonHagNDaz17-Apr-07 8:02 
GeneralRe: __.dll not found. Re-installing the application... Pin
Mark Salsbery17-Apr-07 8:23
Mark Salsbery17-Apr-07 8:23 
GeneralRe: __.dll not found. Re-installing the application... Pin
VonHagNDaz17-Apr-07 8:26
VonHagNDaz17-Apr-07 8:26 
GeneralRe: __.dll not found. Re-installing the application... Pin
Mark Salsbery17-Apr-07 8:32
Mark Salsbery17-Apr-07 8:32 

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.