Subj : fstream - opening a binary file in second obj To : borland.public.cpp.borlandcpp From : D Kat Date : Mon Oct 25 2004 05:32 pm Thanks to all the help in this room I was able to clean up code and put all of the subroutines that student programmers should not play with in a separate source file that they can now load as an obj file in a project. However in putting all of the code related to the ISR in this object file I had to include the fstream binary file that is opened. This code now will not return anything at all. So when I step through the code the file stream is empty - so before and after wavefile.open wavefile in WATCH looks like wavefile = { }. The ISR is working fine in that the counter in it is counting just fine. I have not played out a sound file yet because I'm stuck in not being able to open one. I have checked, double checked, and keep on checking. The file is there, the name is correct, etc. I have no idea what or where to check at this point. wavefile is 0. Any ideas? fstream wavefile; int get_stimuli(char *name) //open and read sound file { wavefile.open(name,ios::binary); //OPEN if (!wavefile) { cout << "\nCannot open file: "<< name << endl; return(-1); } wavefile.seekg(0,ios::end); // goto EOF file_length=wavefile.tellg()/2; // get length of file wavefile.seekg(0,ios::beg); //goto BOF for(int i=0;i