Debugging and Distributing a component developed with Borland C++ Builder

Component Development Kit for THRSim11

© Alex van Rooijen, Bart Grootendorst, Paul Zandbergen and Harry Broeders.


Previous page Next page Index

This page explains:

The component used as an example is the LED component based on the VCL.

How to debug a component developed with Borland C++ Builder.

Open the options dialog by using the Project, Options... menu item. Select the Compiler tab and press the Full debug button.

Use the Run Parameters... dialog to define C:\Program Files\THRSim11\program\gui.exe as Host Application.

Place a breakpoint. For example on the TForm1::Action2Execute memberfunction.

Use the button to start THRSim11. When you open the LED component and choose Toggle in the popup menu the execution will stop at the breakpoint.

You can now use all Borland C++ debug commands. For example: use the button to execute one line.

You can use the Run, Inspect... menu item to open the Debug Inspector dialog. You can inspect the state of the coc->get().

When you make a step over using the F8 key you can see that the value of coc->get() changed.

Use the button to resume the execution of THRSim11.

Intermetso: How to remove the "Parameter 'Sender' is never used" warnings.

If you compile the LED component you will get 3 warnings:

These warnings can be removed by deleting the parameter name Sender.

How to distribute a component developed with Borland C++ Builder.

Open the options dialog by using the Project, Options... menu item. Select the Compiler tab and press the Release button.

You can build the component in 2 ways:

Create a minimal sized dll.

Open the options dialog by using the Project, Options... menu item. Select the Linker tab and check the Use dynamic RTL checkbox.

Select the Packages tab and check the Build with runtime packages checkbox.

When you build the led.dll now its size is 120 kB. But when you want to use this dll on a system where Borland C++ Builder 6.0 is not installed you need to provide the following dll's:

You can find the dependencies of led.dll by using the dependicy walker which can be found at: http://www.dependencywalker.com/

Create a stand alone dll.

Open the options dialog by using the Project, Options... menu item. Select the Linker tab and uncheck the Use dynamic RTL checkbox.

Select the Packages tab and uncheck the Build with runtime packages checkbox.

When you build the led.dll now its size is 568 kB. But when you want to use this dll on a system where Borland C++ Builder 6.0 is not installed you don't need to provide any other files.


For comments and/or suggestions: cdk@hc11.demon.nl