I have previously used CEF4Delphi in a C++Builder project that I had built in Tokyo. I have updated that project to Sydney 10.4.2 and decided to update CEF4Delphi to the latest version. I downloaded CEF4Delphi that uses CEF 92.0.25 which includes Chromium 92.0.4515.131. and installed compeonents with no issue. SimpleBrowse2 demo project compiles fine with Delphi and runs with no problems.
I ported the project to C++Builder. When I try to compile it. I get the following error:
[bcc32 Error] SimpleBrowser2.cpp(14): E2015 Ambiguity between 'Ucefapplication::GlobalCEFApp' and 'Ucefapplicationcore::GlobalCEFApp'
in this code:
try
{
GlobalCEFApp = new TCefApplication();
GlobalCEFApp->IgnoreCertificateErrors = true;
if( GlobalCEFApp->StartMainProcess() )
{
Application->Initialize();
Application->MainFormOnTaskBar = true;
Application->CreateForm(__classid(TForm1), &Form1);
Application->Run();
}
GlobalCEFApp->Free();
GlobalCEFApp = NULL;
}
Thanks,
Elias
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.
Latest CEF4Delphi and C++Builder
- salvadordf
- Posts: 4580
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Latest CEF4Delphi and C++Builder
Hi,
I'm not a C++ builder expert and I don't even have a license to use it but perhaps you can avoid that problem if you move the GlobalCEFApp variable declaration to a new unit.
At this moment, GlobalCEFApp is declared in two units : ucefapplication.pas and ucefapplicationcore.pas
Delete those 2 declarations and move it to uCEFTypes.pas or to a new unit.
I'm not a C++ builder expert and I don't even have a license to use it but perhaps you can avoid that problem if you move the GlobalCEFApp variable declaration to a new unit.
At this moment, GlobalCEFApp is declared in two units : ucefapplication.pas and ucefapplicationcore.pas
Delete those 2 declarations and move it to uCEFTypes.pas or to a new unit.
Re: Latest CEF4Delphi and C++Builder
I just create a local variable by disambiguating it first and use it instead of the global variable:
Code: Select all
TCefApplication* cefApp = Ucefapplication::GlobalCEFApp;
Re: Latest CEF4Delphi and C++Builder
I commented out the line in uCEFApplicationCore.hpp. That resolved the problem.
Thanks
Thanks