帮忙看看这个DLL的问题,谢谢
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, LPVOID lpvReserved)
{
return 1;
}
//---------------------------------------
void __stdcall PrintLabel(char * strdata,char *strfilename)
{
TForm1 *fr = new TForm1(Application);
try{
fr->ClientDataSetLabel->XMLData=strdata;
fr->frxReportLabel->LoadFromFile(strfilename);
fr->frxReportLabel->ShowReport();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
delete fr;
}
我做了个DLL在C#里面调用执行,每次调用ShowReport都能正常显示,但是在C#程序结束调试后,就会出现内存错误之类的,请问我这个DLL写得是否有问题?还是指针这样写有问题呢?
[解决办法]
delete fr;
fr =NULL;
这个函数是怎么到处的
export