The other day as I was developing our own Form Creation code that replaced the need to have compile time construct demanded by
TApplication.CreateForm()
I nearly became a victim of the infamous Delphi's feature disguised as static linkage in .Net.
I got D2006's wizard to create a VCL.Net application project so that it can become a runner using my Delphi class to perform the routine
Application.CreateForm()
where the parameters came from either the configuration file, command line or some other means removing the need to use the name of the type etc. by a call like this:
So when I removed the customarily generated start up form as it would be supplied in another package, that action took the reference of Delphi.Vcl and others from the list of referenced assemblies.
FormLoader.CreateForm( assemblyName,
unitName,
formName,
formVariableName );
When I added a unit to the project and began to use Vcl artefacts in that unit, I did not change the project's references list. The uses statement needed to successfully compile the unit, forces these Vcl types and their supporting types to be transferred into this executable.
Thanksfully my distrust of Borland's output insisting on being validated by Lutz Reflector paid off.
So my next challenge is to develop an automated tool to catch this kind of stupid act.
The recommendation to anyone using Delphi.Net, check your output with Lutz Reflector before each successful compilation! It is a wicked 'feature' only its creator would love it.
No comments:
Post a Comment