-
Notifications
You must be signed in to change notification settings - Fork 30
HeaderTranslationStyle
The Header Translation Style
The translated headers are as close to the original headers, unless there is no possible way to insert or to alter. These translations differ from the earlier translation styles in a way that C++ Builder compiler directives are now included.
Translated headers have the following structure:
- Header info: Contains information about origin, project, copyrights, license etc.
- Unit: Name of the unit. The unitname is capitalized but has the same name as the original header (.h) file.
- Interface
- Uses clause
- Blocks(s) of pre-defined constants, types etc.
- Type block with forwarded interface declarations followed by the Interfaces themselves.
- Additional blocks: Here all helpers and Delphi specific additions are placed (in between the comment blocks "//Additional Prototypes for all interfaces" and "//End of Additional Prototypes". So, here the translations might differ from the official Microsoft implementations.
- Implementation: All functions, classes etc. defined (if needed) in earlier blocks.
What about Delphi naming conventions?
To keep as close as possible to the translated C++ header naming conventions, we did not add Delphi friendly naming stuff if not really necessary. You are free to add those specific Delphi conventions, if you have, need or for any other reason wants to do so. In our opinion those conventions are ridicule and only makes reading the original headers explained on learn.microsoft.com more difficult to read than they should.
What about In, out and var modifiers?
Normally you find in Delphi that const modifiers are left out in function or procedure arguments, because the compiler automatically assumes you mean a const or there is a specific reason to left them out (see further). For pure readability we always use the const modifier to assign an initial value to a variable that should not be changed by the program. ( Note that a C++ const is not the same as in Delphi) There are some exceptions: Interfaces and some pointer types don't have a modifier in a function at all. That is because Interfaces will not have a reference count if the modifier is set to "const". This could create some weird and difficult to trace exceptions.
The WinApiTypes.inc include file
WinApiTypes.inc includes all version types and definitions that are not always present in a Delphi version. To make MfPack as flexible as possible for all Delphi versions, users should read and adjust the content if necessary, to solve compatabilly or/and name-mangling issues and edit adjustments where Embarcadero/Idera did not yet, corrected the Windows Api (rtl/win).
NOTE: This page is always under construction.