Comments (*#_ ... _#*)

Top  Previous  Next

Pretranslated C++ code > Preparing Delphi code > Frequent re-translation > Comments (*#_ ... _#*)

Frequent re-translations can be simplified by automatically insertions of prepared C++ code. Delphi2Cpp interprets the extended Delphi brackets (*#_ ... _#*) in a special way. A text in such brackets is taken unchanged into the C++ code.

 

For example an additional header is included into the C++ code by the following line:

 

(*#_#include "math.h"_#*)

->

//# copied begin

#include "math.h"

//# copied end

 

 

Unfortunately, the positioning of comments is generally a difficult problem because code parsers usually ignore them. The subsequent insertion of comments occurs outside of certain parsed units and therefore sometimes not exactly in the expected places. The user may have to experiment a bit here.

 

Remark: in the first version of Delphi2Cpp program these parenthesis were defined as (*_ ... _*). This led to errors in code like in WinAPI.DXGI1_2.pas:

 

    function GetDisplayModeList1(

      (* [in] *) EnumFormat: DXGI_FORMAT;

      (* [in] *) Flags: UINT;

      (*_Inout_*) var pNumModes: UINT;

      (*_Out_writes_to_opt_(*pNumModes,*pNumModes)*) out pDes: DXGI_MODE_DESC1): HRESULT; stdcall;

 

 

 

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content