Hello, In the WSocket.pas code below (v6):
procedure TCustomWSocket.WndProc(var MsgRec: TMessage); begin try with MsgRec do begin if Msg = FMsg_WM_ASYNCSELECT then WMASyncSelect(MsgRec) else if Msg = FMsg_WM_ASYNCGETHOSTBYNAME then WMAsyncGetHostByName(MsgRec) else if Msg = FMsg_WM_ASYNCGETHOSTBYADDR then WMAsyncGetHostByAddr(MsgRec) else if Msg = FMsg_WM_CLOSE_DELAYED then WMCloseDelayed(MsgRec) // else if Msg = FMsg_WM_WSOCKET_RELEASE then // WMRelease(MsgRec) else if Msg = FMsg_WM_TRIGGER_EXCEPTION then { This is useful to check for background } { In your application, use following code to test your handler } { PostMessage(WSocket1.Handle, WM_TRIGGER_EXCEPTION, 0, } raise ESocketException.Create('Test exception in WSocket') else inherited WndProc(MsgRec); //Result := DefWindowProc(Handle, Msg, wParam, LParam); end; except on E:Exception do HandleBackGroundException(E); end; end; I randomly get the test exception fired in my code. It used to give AV but now after some more work, it now gives this. I do not have any code such as PostMessage(WSocket1.Handle, WM_TRIGGER_EXCEPTION, 0, 0); as stated in the code. How can I understand which line of code or sequence causes the problem? Best Regards, SubZero -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be