function SendSms(pSrcTermID: pchar; pDestTermID: pchar; pContent: pchar; bNeedReport: boolean; pMsgID: pchar): integer; stdcall; external 'SmgpSDK.dll' name 'SMGP_SendSms';
pMsgID: array[0..254] of char;
SendSms(..., pMsgID);
调用完后pMsgID中有你要的值了。
注意你得先确定pMsgID最长有多少字节,然后数组设置为该大小就可以了,不一定是254
把var去掉
function SendSms(pSrcTermID: pchar; pDestTermID: pchar; pContent: pchar; bNeedReport: boolean; pMsgID: pchar): integer; stdcall; external 'SmgpSDK.dll' name 'SMGP_SendSms';
指针本身就是一个可变的值,不变的是地址
所以没必要加var
直接pchar