TagMonitor is a native C++Builder component. It uses the windows event mechanism to notify a monitor application when errors, warnings or notable other things occur. The package contains a sample monitor application and a simple unit. The latter can be used to add the functionality of the component to unit without forms, like threads or other components.
This package was designed to add an easy error-reporting mechanism to your application. It can be a valuable tool for debugging and might even be useful in some delivered applications.
TagMonitor comes as freeware with complete source.
The software is provided as is, without any warranty. You use the software completely at your own risk and the autor is not responsible for any damage that is caused by this software. The software was virus-checked before uploading, but there is no guaranty of the absence of viruses or other malicious routines. If downloaded files are infected, there is no liability by the author of the software or the owner of the site you downloaded the software
The package comes free of any charge. But to use the units in your application you have to do the following:
The copyright message in any of the files must not be removed.
If you edit the files you add your name and what has been changed. You also have to change the values of the constants MonitorData and MontorEvent.
If the final code contains the MonitorBase unit, you have to mention this in the documentation you provide with your application. Please add something like Contains TagMonitor-Component © 2001 by Torsten A. Gattung (gattung@software-test.de). [ MonitorData =xMonitorData, MontorEvent=xMonitorEvent ]. where xMonitorData resp. xMonitorEvent are the names you gave to the specific constant. Please note: This is important and not to please my ego, since it is necessary for other developers to know, if applications running on their computers use this mechanism.
If you find bugs or experience any other problem, please let me know: gattung@software-test.de
Please send any kind of critics to gattung@software-test.de.
The newest version of the package can be downloaded from www.software-test.de/downloads/tagmonitor.zip.
If you want to be informed about new releases, please send an email to gattung@software-test.de with subject Register TagMonitor If you want to unsubscribe from this list, please send an email to gattung@software-test.de subject Unsubscribe TagMonitor.
First unzip the zip file into a subdirectory of your component directory, typicall $(BCB)\Projects\Components\TagMonitor. Before installing, you should scan all files, especially the exe- and bpl files, for viruses. It is recommended to copy the TagMonitor.bpl into your bpl directory and also to copy the TagMonitor.bpi and TagMonitor.lib into your lib directory.
Then start C++Builder and goto Components | Install Packages. Look for the file called TagMonitor.bpl and install it. The Component will be installed onto the SWT-page of your component palette.
It might be useful to create a shortcut to the monitor.exe at your desktop.
Drop the component to your form. The component has only one published property, called AppID. You could enter a string for identifying signals from this application or form in the monitor later. You can add a copy of the component to any other form or access the component from outside, since it is in the published section of your form.
When ever something noteworthy happens, you can use one of the three functions:
void __fastcall SendError(String Message, int ErrorCode=0);
void __fastcall SendWarning(String Message, int ErrorCode=0);
void __fastcall SendInfo(String Message, int ErrorCode=0);
All expect a string and an integer. The integer value is optional and used to transmit an error code. I recommend to use this error code. Although the demo app only displays the error code, this feature has great potential, if you implement filters or triggers in your monitor.
Each of the three functions sets a different flag to the message transmitted. In the sample app, this flag could be filtered, so that for example only error messages are shown. If you set the filter to a lower level, all messages at this level and above pass through, i.e. error messages will always be displayed.
Please Note: Although the string parameter can be of any length, the message transmitted is only 250 characters long. Any character after 250 will be cut of without warning. (No the component does not use the monitor-mechanism itself). To change this limit look at Changing the source below.
This unit contains all necessary classes to use the monitor-mechanism without the TagMonitor component. You have to add the unit to your application and include the header into all files that should be monitored. The easiest way is to add a TMonitorSender object to your file. Please Note: TMonitorSender is no descendant of TObject so it is no VCL-Class and therefore might be instantiated like any C++ class could. (i.e. you do not need to use pointers). If you use TMonitorSender within a thread, you can declare the variable MyMonitorSender and have not to worry about freeing it again. Again the three functions SendEror, SendWarning and SendInfo with the same signature like above are available.
The main form of the monitor application starts a thread, that listens to the specified events and fires an OnMessage-event. The main window displays the message then in the RTF-Window. You can reduce the output by setting the filter to warnings or errors only. This particular monitor application was designed to display some information while debugging and for demonstration purposes. It was not designed as a background process that is started with windows and logs events all the time, although it might be easily transformed into such an application.
As long as you only use the component resp. unit oder modify the monitor-application nothing needs to be done. But please note: Before you edit the data structure, i.e. especially the TMonitorData struct, you have to change the constant names defined in MonitorBase! Otherwise your application will conflict with any application that uses this mechanism. I recommend to add your complete Name to the defined MonitorData resp. MontorEvent variables in this file. Even if you only change the constant MaxCharLength, you have to update the names.
Please send questions or any kind of critics to gattung@software-test.de. Please let me know if you have problems or find bugs with the application, its installation or the documantation.
Torsten A. Gattung
gattung@software-test.de