combit List & Label 24 - .NET Online Web Help
Debugging
Programming Introduction > Other Important Concepts > Debugging

Problems occurring on the developer PC can be easily found in most cases. The usual features of the development environment can be used to spot a problem relatively quickly. The first step is to catch any occurring exceptions and to find their cause (see also Error Handling with Exceptions").

As a development component List & Label is naturally run under a variety of different constellations on the end user side. To find problems there as easily as possible a dedicated debug tool is available which provides a logging function for problems occurring rarely or only on certain systems so problems can also be examined under systems without a debugger. Of course the logging function can also be used on the developer PC and provides the possibility to check all calls and return values at a glance as well.

 

Create Log File

If a problem only occurs on a customer system, the first thing to do is to create a log file. The tool Debwin can be used for this purpose. It can be found in the Miscellaneous directory of the List & Label installation. Debwin has to be started before the application. By Capture List & Label Log the logging is activated. If the application is started afterwards, all calls of the component with their return values as well as additional information about module versions, operation system, etc. will be logged. Every exception thrown under .NET represents a negative value of a function in the log. There is usually more helpful information in the log, a typical output could look as follows:

...

INFO  CMLL24 LL.API 3468 14:41:30.233 >LlSelectFileDlgTitleEx(2,000A1938,'Designer',0x00008001,145F9638='''',16384,00000000)
INFO  CMLL24 LL.API 3468 14:41:31.563 <LlSelectFileDlgTitleEx() -> -99 (FFFFFF9D) (The user has terminated the operation.)
INFO  CMLL24 LL.API 3468 14:41:31.564 >LlGetErrortext(-99,14580D10,16384)
INFO  CMLL24 LL.API 3468 14:41:31.564 <LlGetErrortext() -> 0 (00000000) ['The user has terminated the operation.']
ERROR CMLL24 LL.NetFX 3468 14:41:31.584 ERR: Caught LL_User_Aborted_Exception (The user has terminated the operation.).
ERROR CMLL24 LL.NetFX 3468 14:41:31.584 ERR:  Inner Exception:  ()
ERROR CMLL24 LL.NetFX 3468 14:41:31.584 ERR:  Stack Trace:
ERROR CMLL24 LL.NetFX 3468 14:41:31.584 ERR:     at combit.ListLabel24.LLException.CheckReturn(Int32 returnValue)
ERROR CMLL24 LL.NetFX 3468 14:41:31.584 ERR:    at combit.ListLabel24.LlCore.LlSelectFileDlgTitleEx(IntPtr windowHandle, String title, LlProject projectType, String& projectFile)
ERROR CMLL24 LL.NetFX 3468 14:41:31.584 ERR:    at combit.ListLabel24.ListLabel.DesignLabelFromRelationalDataSource(IDataProvider dataSource, String designerTitle, LlProject projectType, String projectFile, Boolean showFileSelect)
ERROR CMLL24 LL.NetFX 3468 14:41:31.584 ERR:    at combit.ListLabel24.ListLabel.AutoDesign(String designerTitle, LlProject projectType, String projectFile, Boolean showFileSelect)

...

First you see the type of output followed by the DLL that created the output. Then comes the location within List & Label, the thread ID and a timestamp for the output as well as the actual call with all parameters. In the following line the error code (-99) is returned as well as an explanation for it – in this case the user has aborted the file selection dialog with "Cancel”.

If the application is supposed to create debug logs without the help of Debwin, this can be done in the configuration file of the application. Logging can be forced as follows:

<configuration>

 <appSettings>

  <add key="ListLabel DebugLogFilePath"

    value="c:\users\public\debug.log "/>

  <add key="ListLabel EnableDebug" value="1"/>

 </appSettings>

</configuration>