Branch 5993 - Some issues with CefString to CString (MFC)

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Branch 5993 - Some issues with CefString to CString (MFC)

Postby miro » Wed Nov 29, 2023 11:12 am

Hi,
after beginning problem which i could solve, now i have the dlls i need (ceflib.dll and other).
But this time im facing some new issues with strings, when i try to assign CefString to CString i get errors i never had before and our implementation is from 2018, current CEF Version is the 112 branch 5615 build.

When i assign value from CefString to CString MFC, i never get any errors, but now i get the error:
"error C2679: binary '=': no operator found which takes a right-hand operand of type 'const char16_t *' (or there is no acceptable conversion)"

My current SDK installed:
Windows SDK 10.0.18362.1
Windows SDK 10.0.19041.685
Windows SDK 10.0.20348.1
Windows SDK 10.0.22000.832
Windows SDK 10.0.22621.1778
Windows SDK 10.0.22621.2428

I understand the error, but i dont understand why is comming now for first time after 2018 without changing our code. Our build process is also the same and is from the automated build steps which works before always.
Our current version is the 112 from branch 5615, so my question is are there any changes related to CefString since version 112 branch 5615? Or did i build with some flags without noticing it :shock: :o
I build CEF as 32bit output
Here is a simple example which describes my question ( i removed redundant code and let only that for example):
Code: Select all
void CCefTabCtrl::OnIpcMessage(CefRefPtr<CefProcessMessage> message)
{   
         CefString strJson;
         if (arguments->GetSize() >= 2)
            strJson = arguments->GetString(1);
         // Structure with some numeric  and string fields as CString like CString strJsonParam;
         CefCallbackThreadInfo* pInfo = new CefCallbackThreadInfo();
         
         pInfo->strJsonParam = strJson.c_str();  // THIS LINE FAILS NOW
          // but this works:
         pInfo->strJsonParam = strJson.ToWString().c_str(); // BUT THIS WORKS
   
}

One short example which i tested on the cefclient app with same error:
Code: Select all
CString csMFCString;
CefString cefString = "Test content";
csMFCString = cefString.c_str(); // WORKS with 112 on branch 5615 but now i get the error above
csMFCString = cefString.ToWideString().c_str(); // THIS WORKS no errors with version 118 and branch 5993


Any hint for this behaviour, did anyone facing same or similar issue?
Thanks for any input
regards
miro
miro
Techie
 
Posts: 29
Joined: Wed Oct 14, 2020 5:48 am

Re: Branch 5993 - Some issues with CefString to CString (MFC

Postby magreenblatt » Wed Nov 29, 2023 12:04 pm

magreenblatt
Site Admin
 
Posts: 12357
Joined: Fri May 29, 2009 6:57 pm

Re: Branch 5993 - Some issues with CefString to CString (MFC

Postby miro » Mon Dec 04, 2023 2:00 am

Hi,
thank you for this hint, i think i found a commit related to this change, https://bitbucket.org/chromiumembedded/ ... 865864a3d8
this solved my problem with the strings, after fix to the strings i got error:
cef_ref_counted.h(487,32): error C2061: syntax error: identifier 'in_place_t'

Code: Select all
 explicit RefCountedData(std::in_place_t, Args&&... args)
     : data(std::forward<Args>(args)...) {}

// same file but older 112 cef version
 explicit RefCountedData(in_place_t, Args&&... args)
     : data(std::forward<Args>(args)...) {}


Only the "std::" is difference, did i miss again some change after 112? :/
I checked now all the commits back to 2023-04-27 where is the update from 112 to 113 announced bu i could not find anything related to this in_place_t issue.
This is how we build our solution settings:
Build: Win32
SDK: 10.0( latest installed version)
Platform toolset: Visual Studio 2022 (v143)
C++ Language Standard: Default (ISO C++ 14 standard) // I hope this should not be a problem because in CEF 112 was also the C++ 17 required but it worked
C Language Standard: Default (Legacy MSVC)

i could not find any commit which can be related to my new issue.
Thank you
miro
miro
Techie
 
Posts: 29
Joined: Wed Oct 14, 2020 5:48 am

Re: Branch 5993 - Some issues with CefString to CString (MFC

Postby ndesktop » Mon Dec 04, 2023 2:15 am

I think /std:c++17 is required.
ndesktop
Master
 
Posts: 739
Joined: Thu Dec 03, 2015 10:10 am

Re: Branch 5993 - Some issues with CefString to CString (MFC

Postby miro » Mon Dec 04, 2023 7:06 am

Hi,
tanks for answer, i read already about this, if i remember correctly its implemented last year, that we should use the C++ 17 standard, but i could also build my 112 in April with the old C++14.
But i will try it with 17 and will see how its works.
Tanks again.
Miro
miro
Techie
 
Posts: 29
Joined: Wed Oct 14, 2020 5:48 am

Re: Branch 5993 - Some issues with CefString to CString (MFC

Postby miro » Mon Dec 11, 2023 3:43 am

Hi,
just want to give some feedback, i successfully updated CEF to 118 with the support here from forum.
Updated C++ standard from 14 to 17 to fix the CefString, after them there was some issue with the byte "error C2872: 'byte': ambiguous symbol" but for this exits already a workaround.

Thanks for all :)
miro
miro
Techie
 
Posts: 29
Joined: Wed Oct 14, 2020 5:48 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 30 guests