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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Application-defined exception on ICEFv8Value.GetKeys

Post Reply
User avatar
salvadordf
Posts: 4565
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Application-defined exception on ICEFv8Value.GetKeys

Post by salvadordf »

Hi,

Please, set a breakpoint at the Avalue.GetKeys(LKeys) line and click F7 (trace into) when the debugger reaches that line.

It should go to TCefv8ValueRef.GetKeys and possibly to TCefCustomStringList.CopyToStrings but there are some other CEF functions around there and it would be helpful to know the exact code line where the exception is raised.
User avatar
salvadordf
Posts: 4565
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Application-defined exception on ICEFv8Value.GetKeys

Post by salvadordf »

CEF have special functions to handle JSON strings :
  • CefParseJson
  • CefParseJsonAndReturnError
  • CefWriteJson


These are the CEF code comments for those functions :

Code: Select all

///
// Parses the specified |json_string| and returns a dictionary or list
// representation. If JSON parsing fails this function returns NULL.
///
CEF_EXPORT struct _cef_value_t* cef_parse_json(
    const cef_string_t* json_string,
    cef_json_parser_options_t options);

///
// Parses the specified |json_string| and returns a dictionary or list
// representation. If JSON parsing fails this function returns NULL and
// populates |error_code_out| and |error_msg_out| with an error code and a
// formatted error message respectively.
///
CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error(
    const cef_string_t* json_string,
    cef_json_parser_options_t options,
    cef_json_parser_error_t* error_code_out,
    cef_string_t* error_msg_out);

///
// Generates a JSON string from the specified root |node| which should be a
// dictionary or list value. Returns an NULL string on failure. This function
// requires exclusive access to |node| including any underlying data.
///
// The resulting string must be freed by calling cef_string_userfree_free().
CEF_EXPORT cef_string_userfree_t
cef_write_json(struct _cef_value_t* node, cef_json_writer_options_t options);
Perhaps you need to use them at some point.

It would also be helpful If you have a small demo project that you can share to reproduce the exception.
User avatar
salvadordf
Posts: 4565
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Application-defined exception on ICEFv8Value.GetKeys

Post by salvadordf »

I saw your reply but I posted the second message anyway because it might be useful if you handle JSON strings :)
Post Reply