I'm trying to build a program for release, but even though it works fine in a debug configuration, I am getting this error when I use the release configuration:
1>c:\users\owner.ben-pc\documents\visual studio 2010\projects\xsp quick unpacker\xsp quick unpacker\Form1.h(217): error C2664: 'DeleteFile' : cannot convert parameter 1 from 'const char *' to 'LPCTSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
I tried adding the "#define _SECURE_SCL 0" line as per this thread, but that didn't change anything.
Here's the part of the program that the line that is throwing the error is in (the "DeleteFile(temp);" is the specific line that throws the error):
path=this->FilePathBox->Text;
if (!File::Exists(path+"\\filemaker\\start.ini"))
{
FileStream^ fs=File::Create(path+"\\filemaker\\start.ini");
delete fs;
}
else
{
marshal_context^ context=gcnew marshal_context();
String^ filepath=path+"\\filemaker\\start.ini";
const char* temp;
temp=context->marshal_as<const char*>(filepath);
DeleteFile(temp);
delete context;
}
P.S. I'm using VS 2010 Premium.