Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

OldCEF4Delphi TChromiumWindow in C++ Builder Form

Post Reply
Coder
Posts: 2
Joined: Fri Jan 15, 2021 2:49 am

OldCEF4Delphi TChromiumWindow in C++ Builder Form

Post 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;
User avatar
salvadordf
Posts: 4042
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: OldCEF4Delphi TChromiumWindow in C++ Builder Form

Post 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.
User avatar
salvadordf
Posts: 4042
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: OldCEF4Delphi TChromiumWindow in C++ Builder Form

Post by salvadordf »

I just removed those declarations from the OldCEF4Delphi project.

Please, download OldCEF4Delphi again from GitHub.
Post Reply