S
setking
Unregistered / Unconfirmed
GUEST, unregistred user!
如题,帮忙解决啊!!!
拨号的代码如下:
procedure TForm1.dialer(num: string);
Var
PhoneNumber: string;
CommPort: String;
NumberWritten: Dword;
lpdcb:Tdcb;
hCommFile: THANDLE;
Begin
PhoneNumber := 'ATDT'+Num + #13 + #10;
CommPort :='COM1';
{Open the comm port}
hCommFile := CreateFile(PChar(CommPort),GENERIC_WRITE,FILE_SHARE_WRITE,Nil,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
If hCommFile=INVALID_HANDLE_VALUE Then
Begin
ShowMessage('Unable to open '+ CommPort);
Exit;
End;
{Dial the phone}
NumberWritten := 0;
setupcomm(hCommFile,4096,4096);
getcommstate(hCommFile,lpdcb);
lpdcb.baudrate:=9600;
lpdcb.StopBits:=OneStopBit;
lpdcb.ByteSize:=8;
lpdcb.Parity:=NoParity;
Setcommstate(hCommFile,lpdcb);
If WriteFile(hCommFile,PChar(PhoneNumber)^,Length(PhoneNumber),NumberWritten,Nil) = false Then
Begin
showmessage('Unable to write to ' + CommPort);
End;
end;
如何用AT指令播放WAV语音文件啊????????
拨号的代码如下:
procedure TForm1.dialer(num: string);
Var
PhoneNumber: string;
CommPort: String;
NumberWritten: Dword;
lpdcb:Tdcb;
hCommFile: THANDLE;
Begin
PhoneNumber := 'ATDT'+Num + #13 + #10;
CommPort :='COM1';
{Open the comm port}
hCommFile := CreateFile(PChar(CommPort),GENERIC_WRITE,FILE_SHARE_WRITE,Nil,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
If hCommFile=INVALID_HANDLE_VALUE Then
Begin
ShowMessage('Unable to open '+ CommPort);
Exit;
End;
{Dial the phone}
NumberWritten := 0;
setupcomm(hCommFile,4096,4096);
getcommstate(hCommFile,lpdcb);
lpdcb.baudrate:=9600;
lpdcb.StopBits:=OneStopBit;
lpdcb.ByteSize:=8;
lpdcb.Parity:=NoParity;
Setcommstate(hCommFile,lpdcb);
If WriteFile(hCommFile,PChar(PhoneNumber)^,Length(PhoneNumber),NumberWritten,Nil) = false Then
Begin
showmessage('Unable to write to ' + CommPort);
End;
end;
如何用AT指令播放WAV语音文件啊????????