H
HLHGOD
Unregistered / Unconfirmed
GUEST, unregistred user!
小可正在学习如何通过GSM Modem发短信,但厂家提供的smspud.dll在delphi中调用老是出错,有对串口编程熟悉的大虾请指点一下。
procedure TForm1.Button1Click(Sender: TObject);
var
StrCenterNumberChar;
begin
getmem(StrCenterNumber,16);
if OpenComm(PChar('COM1'),CBR_9600,NOPARITY,8,ONESTOPBIT) then
begin
SetSendModule(0);
GetCenterNumber(StrCenterNumber);
try
// SetCenterNumber(StrCenterNumber);//这句一执行就出错
edit1.Text:=StrCenterNumber;//取不出短信中心的号
except
end;
end;
closeComm;
freeMem(StrcenterNumber);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
StrCenterNumberChar;
begin
getmem(StrCenterNumber,16);
if OpenComm(PChar('COM1'),CBR_9600,NOPARITY,8,ONESTOPBIT) then
begin
SetSendModule(0);
GetCenterNumber(StrCenterNumber);
try
// SetCenterNumber(StrCenterNumber);//这句一执行就出错
edit1.Text:=StrCenterNumber;//取不出短信中心的号
except
end;
end;
closeComm;
freeMem(StrcenterNumber);
end;