Sector7CSD
Still Fresh
- Joined
- May 24, 2009
- Messages
- 2
Hi,
I try to read files from the wiz via the standard c++ way and everytime it fails. If I run the application on my PC it will open the file correctly. I searched already the internet for informations and found that some programs use a function called "GpFileOpen" - but for this one, I can't find any headerfile.
Here a small code snippet of what I'm trying to do:
CODE
std::fstream data(File, std::ios::in | std::ios::binary);
if(data.good())
{
// obtain file length
data.seekg(-1, std::ios::end);
int Length = (int)data.tellg()+1;
// read file once
data.seekg(0, std::ios::beg);
char * pSong = new char[Length];
data.read(pSong, Length);
data.close();
}
fopen will also fail. I assume that the current directory is set to the directory where my executable lies. The file lies in the same directory as the executable.
Does someone know what I do wrong ?
I try to read files from the wiz via the standard c++ way and everytime it fails. If I run the application on my PC it will open the file correctly. I searched already the internet for informations and found that some programs use a function called "GpFileOpen" - but for this one, I can't find any headerfile.
Here a small code snippet of what I'm trying to do:
CODE
std::fstream data(File, std::ios::in | std::ios::binary);
if(data.good())
{
// obtain file length
data.seekg(-1, std::ios::end);
int Length = (int)data.tellg()+1;
// read file once
data.seekg(0, std::ios::beg);
char * pSong = new char[Length];
data.read(pSong, Length);
data.close();
}
fopen will also fail. I assume that the current directory is set to the directory where my executable lies. The file lies in the same directory as the executable.
Does someone know what I do wrong ?