异常求助(20分)

E

eChenXi

Unregistered / Unconfirmed
GUEST, unregistred user!
当我脱离Delphi环境运行应用程序,关闭程序时有时会出现‘应用程序发生异常 未知的软件异常(0X0eedfade),
位置为0x77eb7e08)’这种错误。而且异常的代码经常不同(还有oxc000001d),位置也经常不同。哪为高手知道,
不葚感激。
 
我的程序是一个ClientSocket程序,使用clBlocking和线程方式。线程用TWinSocketStream
收发数据。大体框架是:
MySocket:TCustomWinSocket;
TheStream:TWinSocketStream;
constructor TMyThread.create(skt: TCustomWinSocket);
begin
MySocket := skt;
TheStream:=TWinSocketStream.Create(skt, 1000);
inherited create(false);
end;
procedure TMyThread.Execute;
begin
while not terminateddo
begin
if not MySocket.Connected then
begin
terminate;
exit;
end;
if theStream.WaitForData(1000) then
begin
if not MySocket.Connected then
begin
terminate;
exit;
end;
。。。。。。。。。。。。
TheStream.Read(aBuf,1024);
end;
//下面是处理Socket收发数据
。。。。。。。。。。。。。。。
if (.....) then
TheStream.Write(aBuf,aBufSize);
end;
ClientSocket的Connect事件
procedure TForm1.SMUpSktConnect(Sender: TObject;
Socket: TCustomWinSocket);
begin
TheMyThread := TMyThread.create(Socket);
end;
应用程序关闭、
procedure TForm1.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
if TheMyThread<>nil then
begin
ClientSocket.Close
TheMyThread.Terminate;
end;
end;
我在Delphi环境下调试怎么也找不出问题。可是脱离Delphi环境运行应用程序,关闭程序时,有时就会出现
‘应用程序发生异常,未知的软件异常(0x0eedfade),位置为0x77e67e08'的错误。
 

Similar threads

回复
0
查看
658
不得闲
S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
顶部