GUI_LANG_GetTextBuffered() returns 0 (success) although GUI_GET_DATA_FUNC fails

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • GUI_LANG_GetTextBuffered() returns 0 (success) although GUI_GET_DATA_FUNC fails

    Hi,

    I call GUI_LANG_GetTextBuffered() to get a text.
    In some special case in my corresponding Get Data function I must return 0 (because of a failure).
    I trusted GUI_LANG_GetTextBuffered() will then return with 1 (= error) to handle this case.
    But in fact GUI_LANG_GetTextBuffered() returns 0 (= success). This is fatal, because this deceives a valid text in the buffer. But it isnt.

    Do I something wrong?
    How can I return an error within the GetData function back to emWin, so that emWin is able to handle this appropriately and pass the error up to ...GetTextBuffered()?

    Best regards
    Matz
  • Does anyone has an idea?

    The scenario problematically:

    1. GUI_LANG_LoadTextEx(pfGetData,...) is called successfully, initialising the language textes (file is opened, pfGetData is called a few times). So far.

    2. In between we assume file is temporary no accessable.

    3. The following GUI_LANG_GetTextBuffered(...,pBuffer,...) calls my pfGetData. I return pfGetData with 0 (to indicate: 0 Bytes read).
    Nevertheless GUI_LANG_GetTextBuffered is returning 0 = suggesting success, thus suggesting valid filled text buffer (pBuffer). However the buffer has not been filled!

    Can somebody help with an idea how to handle this scenario?

    Best regards
    Matz