下面是一个向MODEM发送AT指令的过程,就是在这里不能设置断点。高手帮忙看看procedure TFMain.DSendClick(Sender: TObject); var Async: THandle; begin if Edit.Enabled and not Edit.Focused then Edit.SetFocus; if (msCommandState in Modem.ModemState) then begin Modem.SendCommand(Edit.Text); end else if not (loSend in Modem.Locked) then begin Modem.PurgeIn; BufStr := ''; if (Memo.Lines[Memo.Lines.Count-1]<>'') then Memo.Lines.Add(''); Async := Modem.InitAsync(nil, True); Modem.SendStringAsync(Async, Edit.Text+#13#10); ShowMessage('ok'); end; end;
另外有些在线程中也不能调试
var Async: THandle;
begin
if Edit.Enabled and not Edit.Focused then Edit.SetFocus;
if (msCommandState in Modem.ModemState) then
begin
Modem.SendCommand(Edit.Text);
end
else if not (loSend in Modem.Locked) then
begin
Modem.PurgeIn;
BufStr := '';
if (Memo.Lines[Memo.Lines.Count-1]<>'') then Memo.Lines.Add('');
Async := Modem.InitAsync(nil, True);
Modem.SendStringAsync(Async, Edit.Text+#13#10);
ShowMessage('ok');
end;
end;
你看看菜单:Project -> Options 的 Compiler页
里面有个Debugging的GroupBox,里面的Debug information必须要选上
否则就没有调试的可能了