Home > Back-end >  C # LPTSTR StringBuilder to Delphi
C # LPTSTR StringBuilder to Delphi

Time:09-24

C # LPTSTR StringBuilder type how to Delphi

CodePudding user response:

The original statement is written so,
Public static extern EErrorCode titr_makeDateTimeString (int iYear, int iMonth, int iDay, int iHour, int iMinute, int iSecond, [MarshalAs (UnmanagedType LPTStr)] StringBuilder pszDateTime , int capacity);


I need to Delphi, thank you,

CodePudding user response:

Use the idapro analysis
Into a C statement below
Int __cdecl titr_makeDateTimeString (int a1, int a2, int a3, int a4, int a5, int a6, would be * a7, size_t a8)
This how to Delphi, thanks.

CodePudding user response:

If this analysis:
Int __cdecl titr_makeDateTimeString (int a1, int a2, int a3, int a4, int a5, int a6, would be * a7, size_t a8)
Is right, should be a c # code to use P/Invoke call external DLL function, is:
The function titr_makeDateTimeString (iYear, iMonth, iDay, iHour, iMinute, iSecond: integer; PszDateTime: PWideChar; Capacity: integer) : integer; Cdecl; External 'XXX. DLL';
  • Related