Dll C函数转Delphi,变参总是返回nil, 请问

Dll C函数转Delphi,变参总是返回nil, 请教!

原Dll中的C函数,
const char* QTTSSessionBegin(const char* params, int* errorCode);
const void* TTSLIBAPI QTTSAudioGet(const char* sessionID, unsigned int* audioLen, int* synthStatus, int* errorCode);
 转成Delphi;
function QTTSSessionBegin(params: pchar; var errorCode: pinteger): Pchar; stdcall; external 'msc.dll';
function QTTSAudioGet(sessionID: PChar; var audioLen: PDWORD;var synthStatus:PInteger; var errorCode: PInteger): Pointer; stdcall external 'msc.dll';
  
pret 只在var 中声明不赋值 pret: Pinteger;
  params := 'ssm=1, auf=audio/L16;rate=16000, aue=speex-wb;7, ent=intp60';
  session_id := QTTSSessionBegin(params, pret);
session_id 返回值正常,但pret 总是nil!

  synth_speech := QTTSAudioGet(session_id, synth_speech_len, synth_status, pret);
synth_speech,synth_speech_len, synth_status用nil 转入,能返回值,但pret总是返回nil !

是我的程序写得不对,还是C函数有问题?请教!


------解决方案--------------------
pret: Pinteger; 改为:
pret: Integer;
------解决方案--------------------
函数中参数var errorCode: pinteger也改为:
var errorCode: Integer