delphi调用vc的dll的问题
在delphi调用了用vc写的dll,它的函数返回值为char *,在dll导出函数原型为:PAPERDLL_API char *PAPERDLL_CALLCONV PD_Get_stuPaperInfo(LPCTSTR strSourceFileName,
LPCTSTR strTemplateFileName,
int paperPageSum,
LPCTSTR strInfoFileName,
LPCTSTR strCutFileName,
int scoreMode);
函数的参数没有问题,返回为一个char *;
在delphi我对该函数做了如下声明:
function PD_Get_stuPaperInfo(strSourceFileName,strTemplateFileName:string;
paperPageSum:integer;
strInfoFileName,strCutFileName:string;
scoreMode:integer):Pchar;stdcall;
external 'PaperDll.dll';
然后调用该函数:
var FStudInfo:PChar;
FStudInfo := PD_Get_stuPaperInfo(FStudentAnswPath,
FLabelPath,
FExamPaperNum,
FWritePath,
FCutPath,
FRegnPattern);
为什么参数返回的为nil?请教解决!谢谢了!