I am trying to create a basic file in Builder c++, however I get a 'Invalid Handle exception c00000008'.
This is the only code I have, behind a button.
void __fastcall TForm1::Button1Click(TObject *Sender)
fs = new TFileStream("c:\\test.log", fmCreate);
Are you sure the exception occurs on the single line of code you show? This can not be "the only code" you have.
fs, the pointer to the stream is a local variable and hence discarded when this function exits. So, what do you intend to do with the file you just created since you do not return the handle to the file. "Invalid Handle" is a clue that somebody else wants to touch that file.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)