Click to See Complete Forum and Search --> : OE Exception caused by writing to ouput file


Diana
March 31st, 1999, 10:25 PM
I'm writing a simple console application in Visual C++ and after no apparent problems in this area of my code, I'm

suddenly getting an OE exception error Access Violation after opening an output file and then passing it to a function.

The file opens successfully, after:

ofstream fout; // an output file

.

.

.

.

fout.open("output.txt",ios::out); // prepare output file

if (!fout)

{

cout << "Cannot open "<< fileName << ".";

return 0;

}

and then at this point when debugging, I notice in the watch, that I have the

error CXX0030 for the ostream __vsptr. It only causes an exception when I pass it to a function which writes to it

with:

fout << GraphName<< endl; // (GraphName is a string)

I've done this many times without problem. I've tried opening a new project, etc,and can't figure out why it's a

problem now.


If anyone has any idea why this would happen, please let me know.


Thanks,

Diana

sqrly
July 19th, 1999, 02:27 PM
Did you ever resolve the CXX0030 error message you were getting? I saw your post. I am getting the same error with a CString member variable in a CDialog class.......thanks.........