Having problems with Components that use other Custom Components [Edit]

I need to understand how the components work and interact with each other better.
I have three components that I have created for my software so they can be included in a bunch of related applications.
Host.bpl - Low level Disk I/O, Licensing, INI file functions, encryption, etc.
Database.bpl - Database functions for many different databases
Resource.bpl - GUI level functions. Any visual components

My Database component uses the Host component for some of its functions
My Resource component uses the Host and Database component functions

All I need to place on my high level applications is my Resource component and all the Database and Host functions are available through its interface. It creates the Database and Host components in an INIT function that My application calls.

This was working fine in the C++ Builder 6 environment as long as I made sure to compile the higher level components when changes were made to the lower level components. With XE3, I am having problems where it seems that libraries are included when they aren't expected; perhaps a different version or at least a new instance.

I see things like:

1) Tracing through a function to have it jump to a completely different function than was shown as the expected calling function in the code, as if the libraries were not linked correctly.

2) Variables in the code do not match the values when the code is executed. For example: Host->DBDir would show C:\MyDir by hovering on it and the value that it would set another value (MyPath = Host->DBDir) would show blank. This implies that the debugger is looking at one instance and the code is using another instance.

3) Component variables that don't get set when they are initialized in the constructor.

I have tried Cleaning, Building, Installing at all levels. Exiting XE3 and restarting. Still no change in the above symptoms. Static or Dynamic libraries, Link with runtime packages or not.

The components work fine by themselves and they used to work when using the highest level component in C++ builder 6.

Edited by: Mike Myhre on Mar 4, 2013 2:21 PM
One thing I should throw it, the two components, Host and Database, were created for use with the firemonkey platform. They only use RTL calls, no VCL or FMX included in them so I think it should work. No compiler errors either.
3/4/2013 10:23:56 PM
public.delphi.vcl.writing 510 articles. 0 followers. Follow

0 Replies

Similar Articles

[PageSpeed] 55