While use of madExcept with CodeSiteEx does NOT involve adding properties to the TcsxErrorTrapControl, usage of madExcept's functionality IS tied to the TcsxErrorTrapControl component. This being the case, in order to use the madExcept's enhanced exception handling features, we must still use the CSX Error Trap Control. For this example, we will leave both the TCSObjectEx and the TcsxErrorTrapControl components on our form.
No change is required to our code to enable the error trapping. The only thing we must do is set the Error Trap Control's Enabled property to TRUE. For the purposes of our demonstration, we will leave our ButtonClick event exactly as it was in our test involving just CodeSiteEx, as seen below:
When we run this code, our error message is displayed:
This time, though, a mountain of data is sent to CodeSite viewer. Click on the thumbnail below to view the full contents:
In addition to the basic exception details presented using just the Error Trap Control, the Inspector Pane now a call stack for this exception, details about the workstation and operating system, even the version of madExcept used to generate the exception log. And again, the best part is no code was required, all we had to do was set an option in the CSX.INC file and rebuild our packages once.