Error 47 error C2664: 'cef_string_alloc' : cannot convert parameter 1 from 'LPCTSTR' to 'const wchar_t *' c:\...\cef\v51\include\cef_win.h 153
This happens in the function because it the windowName parameter is a LPCTSTR and it is passed to cef_string_alloc with wants a const wchar_t.
Here's the code snippet:
- Code: Select all
void SetAsPopup(HWND hWndParent, LPCTSTR windowName) {
...
if(windowName)
m_windowName = cef_string_alloc(windowName);
}
Unfortunately, this doesn't compile on my system, instead I get the error above. I believe this problem goes away if I were to define UNICODE, but that causes other problems in my code base. I think this is a legitimate issue for fixing Cef, but I'm not sure if the right answer is to change the signature of SetAsPopup or to do the conversion frmo LPCTSTR to wchar_t within SetAsPopup.
Should I just raise this as an issue over in the main Cef site?
FWIW, the code works just fine if I do the conversion. But I'd rather not have to deal with this hack in my code base. It'd be better if the Cef code could be updated to address it one way or the other.
-j