I'm triying to do that nifty file-writer DLL. BTW I have this:
#include <fstream>
#include <string>
using namespace std;
extern "C" __declspec(dllexport) int write_file(string fileName, string stringToWrite)
{
ofstream file(fileName.c_str());
file << stringToWrite << endl;
file.close();
return 1;
}
It's still pretty rough, no exception handling and anything, but I was just starting & testing. It compiles OK and all that, but when I do in WME:
external "filehandle.dll" cdecl int write_file(string fileName, string stringToWrite);
write_file("test.txt","testing testing");
I get LOTS of errors, and I mean LOTS!! And it creates a file called "testing testing" or whatever you introduced has stringToWrite, with garbage inside (well, in fact, it ever has this inside: