I am using the code below to try and load a filepath to a bmp file from a txt file. It compiles fine but when I get to the LoadFromFile stmt I get a runtime error "EFOpenError Cannot open file" and then it displays the path it should open so it is reading it correctly. I am using Borland C++ Builder.
Can anyone tell me where I have gone wrong please
ifstream in ("Test.txt");
if( ! in )
Application->MessageBox("Cannot open file.",
"MessageBox",MB_OK + MB_DEFBUTTON1);
Graphics::TBitmap *Bitmap1 = new Graphics::TBitmap();
Image1->Picture->Bitmap = Bitmap1;