I am trying to go 1 record behind from the end of file and then want to read the last record only, but when I do the following, ifstream does read record after seeking, if I seek from the beginning, than it works fine, but there is no limit of records in file, so I want to read the last record only and want to seek from last. Why it doesn't work.
Anybody can help me with this issue?
SuperDeluxRoom temp; // An object of my class
ifstream infile;
infile.open ("SDRoomData.dll", ios::binary);
infile.seekg(-sizeof(SuperDeluxRoom), ios::end);
infile.read(reinterpret_cast<char *>(&temp), sizeof(SuperDeluxRoom));
Don't you have an import table for the DLL? Why are you even trying to do it this way? DLL's are not text files, the functions are already compiled and not in a readable format.
Bro, this dll is written using the same techiques of ofstream as above. So it doesn't matter. And it is not working with .dll or any other file like .dat or .txt
Sorry, I thought that it was an actual compiled DLL. In that case it's because you are trying to set the get pointer with a negative, what you want to do is subtract the size of "SuperDeluxRoom" from the end point of the file and use that as the file position but this is still a bad way to go about it.