First off im a total newbie when it comes to C++, but i was making a binary functions dll in C++ and well it only returns '0' back to me.
The program i use ONLY accepts double and null arguments to be passed back and forth through the dll, so i had to convert the file's binary data into 'double' but like i said i only get '0' in return...
//Define export macro
#define export extern "C" __declspec( dllexport )
using namespace std;
ifstream::pos_type size; //Size of file
char * memblock; //Memory "Storage"
char * pEnd; //End char
double ret; //Variable helps with conversion
export double readFile(PCHAR filepath)
ifstream file (filepath, ios::in|ios::binary|ios::ate);
size = file.tellg();
memblock = new char [size];
file.seekg (0, ios::beg);
file.read (memblock, size);
ret = strtod(memblock,&pEnd); //Damnit! Now to convert :(
return ret; //Return PLEASE! lol
So can anyone help with this? Im pretty sure its the dll thats causing the problem, but im not sure.