1. Capturing TidTCPClient disconnect event or exception
I have a Server/Client app/protocol working well, but both need to be stand-alone. Occasionally the connection gets dropped and the Client computer brings up a modal Windows error message describing why it disconnected. In my particular application, there won't be anyone there to accept the message and try to reconnect. Using the ONDISCONNECT client event doesn't work because the modal message hits before the event. I have a try/except around the place I actually do the connect, but it doesn't fire unless there is a problem in the initial connection. I figure the solution has something to do with the client Intercept or IOHandler Events(?), but I can't find any examples or descriptions on how to use them. Any assistance would be greatly appreciated, especially if it includes where I can look for this kind of information without bothering anyone. Thanks in advance Hank Arnold
2. Can't capture idHTTP exceptions??
3. TDirectoryListBox->Drive, capturing an exception using try
Hello, I want to capture the error message in TDirectoryListBox when you assign a non-existant drive to TDirectoryListBox->Drive. That way I can iterate true all 26 letters of the alphabet to get the good drives. So I dont want the user to see any error messages. I am sure the try/catch block would work but i dont know how to use it please help. Thanks
4. Lib to capture call tree on an exception?
5. Capturing stack trace on exception
I have a Windows CE 5.0 application in which I've installed an exception
filter (code at the bottom of this post) that generates output like this:
H 2006/11/14 12:22:42 Exception 0xC0000005 at address 0x000A4B10.
H 2006/11/14 12:22:42 ExceptionInformation[0] = 0x00000000.
H 2006/11/14 12:22:42 ExceptionInformation[1] = 0x0E00006C.
or this:
H 2006/11/16 09:18:46 Exception 0x80000002 at address 0x03F821D8.
I can interpret the messages, but the problem I have is that I don't get
much information about the context.
Is it possible to get a stack trace and register dump in the exception
filter? If so, is sample code available? Any help on this would be
appreciated.
///
// Exception filter; uses only the most basic C functions to record the
error.
int exceptionFilter(unsigned int code, _EXCEPTION_POINTERS *
exceptionPointers)
{
EXCEPTION_RECORD * exceptionRecord = exceptionPointers->ExceptionRecord;
char errorLogFileName[MAX_PATH];
strcat(strcpy(errorLogFileName, TAppConfig::appConfig.dataDirectory()),
"error.log");
FILE * errorLogF = fopen(errorLogFileName, "ab");
if (errorLogF != 0)
{
SYSTEMTIME systemTime;
GetLocalTime(&systemTime);
fprintf(errorLogF, "H %04hu/%02hu/%02hu %02hu:%02hu:%02hu Exception 0x%08X at address 0x%08X.\r\n", systemTime.wYear, systemTime.wMonth, systemTime.wDay, systemTime.wHour, systemTime.wMinute, systemTime.wSecond, code, exceptionRecord->ExceptionAddress);
for (DWORD index = 0; index < exceptionRecord->NumberParameters; index++)
fprintf(errorLogF, "H %04hu/%02hu/%02hu %02hu:%02hu:%02hu ExceptionInformation[%d] = 0x%08X.\r\n", systemTime.wYear, systemTime.wMonth, systemTime.wDay, systemTime.wHour, systemTime.wMinute, systemTime.wSecond, index, exceptionRecord->ExceptionInformation[index]);
fclose(errorLogF);
}
return EXCEPTION_EXECUTE_HANDLER;
}
6. How to capture mouse during screen capture
7. Exceptions, Exceptions, Exceptions :D
Hmmm
Since I catch the exception... I should be able to continue the program
lol...
But when calling 'get game list' for a second time it will say: connection
already open.
This might be a good example where to include try... finally;
Let's try to think up an example/pseudo code:
try
try
Connection.Open;
ExecuteSql;
except
end;
finally
Connection.Close;
end;
BUT WHAT THE FUCK ABOUT WHEN THE Connection.Open fails ?!
Calling Connection.Close is not wise if connection.open failed !
SO THIS SUCKS
ANOTHER STUPID EXAMPLE OF EXCEPTIONS !
Hmmm let s see maybe try finally is just retarded... and we should use
something else instead.
We could still use try finally.
try
try
Connection.Open;
ExecuteSQL;
except
end;
finally
try
Connection.Close
except
end;
end;
Ieeewwwww..
Am I supposed to program like this ?
Ofcourse this code will probably not work...
Since if Connection.Open fails... it will raise an exception... and that
exception will be caught by the first
exception handler.. so finally will probably never be reached !
Hmmm maybe that's a good thing :)
Since I dont want to call Connection.Close if open fails.
Oh well let's see if that works :D
Skybuck.