Build Delphi Compiler regenerates ActiveX interface without safe-call in XE7

The problem we have is that when a Delphi XE7 project for building a .dll containing a COM interface type library that contains a few “safe-call” functions are being regenerated by the “Build Delphi Compiler” of FinalBuilder in XE7 mode. What we see in the result of this action when things go wrong is that the Delphi XE7 GenTLB utility is called te regenerate the type library, which is not wanted at that time. Aparently this is triggered by the different content of one or more of the project files which contain different data when the .DLL is registered via the Delphi XE7 GUI.

To describe what is going wrong step by step the following:
1- Raise the build number of the application “CEVSDosInfoEnControle.dll” via the XE7 GUI menu “Project | Options…| Version Info"
2- Save all files
3- Build the software with the XE7 GUI.
4- The  “CEVSDosInfoEnControle.dll” is registered via the GUI menu option “Run | ActiveX server | Register"
5- Now the project files are stored in a version control system (the set I sent you in a zipfile) 
6- On an other machine (the build machine) the sources (together with the project files) are downloaded from the version control system.
7- The sources are build via the Delphi XE7 commandline compiler and that is when the problem is manifested: the safe-call entries in the type library are replaced resulting in (among other things) a different _TLB.pas file.

The build machine compiles the Delphi XE7 sources via the commandline compiler as it is used by the Final Builder (version 7) scripting tool. After that the binaries are signed and added to an installer application fit to deliver to the customer.

When in the sequence of events step 4 is skipped the build on the buildmachine runs fine. So the differences that are present in the projectfiles between a set that is the result after step 3 and a set after step 4 triggers a regeneration of the type library files (part of the project files) on the build machine.


==============================================<logging from=”” build machine="">=======================================

Compiler selected is : C:\Program Files (x86)\Embarcadero\Studio\15.0\bin\dcc32.exe
Embarcadero GenTLB Version 12.16581
Copyright© 1995-2010 Embarcadero Technologies, Inc.

Opening  'CEVSDosInfoEnContr.ridl’
Created! 
D:\DB\CentraSys\Centrasys-EVS\2.80_XE7\ClientSources\DosInfoEnContr\Sources\CEVSDosInfoEnContr.tlb
Created! 
D:\DB\CentraSys\Centrasys-EVS\2.80_XE7\ClientSources\DosInfoEnContr\Sources\CEVSDosInfoEnContr_TLB.pas
Type Library Generated OK.
Running Delphi compiler…
Using Command Line :  /B D:\DB\CentraSys\Centrasys-EVS\2.80_XE7\ClientSources\DosInfoEnContr\Sources\CEVSDosInfoEnContr.dpr /Q
Embarcadero Delphi for Win32 compiler version 28.0
Copyright © 1983,2014 Embarcadero Technologies, Inc.
DoseringscontrollerImpl.pas(259) Error: E2291 Missing implementation of interface method IDoseringscontroller.Invalidate
DoseringscontrollerImpl.pas(259) Error: E2291 Missing implementation of interface method IDoseringscontroller.ExecuteVoerBewakingscontroleUit
DoseringscontrollerImpl.pas(259) Error: E2291 Missing implementation of interface method IDoseringscontroller.ExecuteWijzigMedischeIndicatie
DoseringscontrollerImpl.pas(259) Error: E2291 Missing implementation of interface method IDoseringscontroller.StartLeesDosGrenzen
DoseringscontrollerImpl.pas(338) Fatal: F2063 Could not compile used unit ‘FDoelgroepMelding.pas’
==============================================</logging from="" build machine="">=======================================

So please help with resolving this issue. I would like to know how to avoid the regenerating of the type library, or maybe how to let the GenTLB utility regenerate the type library with different parameters so the right type of type library is generated.


Hi

The default options we pass to Gentlb.exe are

-P -T

You can override these by setting the GenTLBSettings option on the Action Inspector view. My guess is you need :

-P -Pt+ -T

The -Pt+ option is not documented anywhere that I can find, but it does the safecall mapping. The -T shouldn’t be needed when overriding but it is for now due to a bug in how we specified the options (I will fix this now!).