Page 1 of 1

OldCEF4Delphi TChromiumWindow in C++ Builder Form

Posted: Fri Jan 15, 2021 3:39 am
by Coder
Hi,

Using C++ Builder 10.4, I am able to add the OldCEF4Delphi ChromiumWindow (TChromiumWindow) to a form (TForm).

However when building, a discrepancy between function declarations in uCEFMiscFunctions.hpp vs. the Windows timezoneapi.h header file are flagged. (Note that uCEFMiscFunctions.hpp is generated from uCEFMiscFunctions.pas in OldCEF4Delphi.)

The two functions are TzSpecificLocalTimeToSystemTime and SystemTimeToTzSpecificLocalTime (see below):

C++
----

extern "C" System::LongBool __stdcall TzSpecificLocalTimeToSystemTime(Winapi::Windows::PTimeZoneInformation lpTimeZoneInformation, Winapi::Windows::PSystemTime lpLocalTime, Winapi::Windows::PSystemTime lpUniversalTime);

extern "C" System::LongBool __stdcall SystemTimeToTzSpecificLocalTime(Winapi::Windows::PTimeZoneInformation lpTimeZoneInformation, Winapi::Windows::PSystemTime lpUniversalTime, Winapi::Windows::PSystemTime lpLocalTime);

Delphi
--------

function TzSpecificLocalTimeToSystemTime(lpTimeZoneInformation: PTimeZoneInformation; lpLocalTime, lpUniversalTime: PSystemTime): BOOL; stdcall; external Kernel32DLL;

function SystemTimeToTzSpecificLocalTime(lpTimeZoneInformation: PTimeZoneInformation; lpUniversalTime, lpLocalTime: PSystemTime): BOOL; stdcall; external Kernel32DLL;

Re: OldCEF4Delphi TChromiumWindow in C++ Builder Form

Posted: Fri Jan 15, 2021 8:01 am
by salvadordf
Thanks for reporting this issue! :)

I'll take a look as soon as I can but meanwhile try to declare them with custom names inside uCEFMiscFunctions.pas.

Perhaps this will remove that discrepancy :

Code: Select all

function CustomTzSpecificLocalTimeToSystemTime(lpTimeZoneInformation: PTimeZoneInformation; lpLocalTime, lpUniversalTime: PSystemTime): BOOL; stdcall; external Kernel32DLL name 'TzSpecificLocalTimeToSystemTime';
function CustomSystemTimeToTzSpecificLocalTime(lpTimeZoneInformation: PTimeZoneInformation; lpUniversalTime, lpLocalTime: PSystemTime): BOOL; stdcall; external Kernel32DLL name 'SystemTimeToTzSpecificLocalTime';
Then replace all TzSpecificLocalTimeToSystemTime and SystemTimeToTzSpecificLocalTime calls in that unit to CustomTzSpecificLocalTimeToSystemTime and CustomSystemTimeToTzSpecificLocalTime.

Re: OldCEF4Delphi TChromiumWindow in C++ Builder Form

Posted: Mon Jan 18, 2021 10:28 am
by salvadordf
I just removed those declarations from the OldCEF4Delphi project.

Please, download OldCEF4Delphi again from GitHub.