public: int Form1::ReadList(){
ifstream pile;
int count = 0;
char inputbuff[100] ={'\0'},*tok,*folder;
String^ poo = textBox1->Text;
char* fil = ConvertString(poo);
progressBar1->Maximum = File_Quant(fil);
pile.open(fil,ifstream::in);
if(!pile.good()){
MessageBox::Show("Please select a valid m3u and path", "Problem",
MessageBoxButtons::OK, MessageBoxIcon::Exclamation);
pile.close();
exit(1);
}
public: char* Form1::ConvertString(String^ cnv){
int length = textBox1->Text->Length;
char *out = new char[length+1];
for(int i = 0;i < length;i++){
out[i] = (char) cnv[i];
out[length] = '\0';
}
return out;
}
public: int Form1::File_Quant(char* fileloc){
int numfiles = 0;
char enbuf[2];
ifstream read;
read.open(fileloc,ifstream::in);
read.getline(enbuf,1,'\n');
while(!read.eof()){
read.getline(enbuf,1,'\n');
numfiles++;}
read.close();
return numfiles;
}
gives me,
debug assertion failed
expression: stream != NULL
and talks about fclose.c when I'm not even calling fclose and I'm checking wheather it opened successfully on the next line
which really confuses me because if I have a file that doesn't exist it doesn't give me this but when its a legitimate file I get it its quite a puzzle.
I really need help , please and thanks.












