Help with DynamicTextGetTextW

thedertom
2024-09-02
2024-09-03
  • thedertom - 2024-09-02

    Hi

    I try to get korean texts out of a textlist. For that I want to use DynamicTextGetTextW, but I am a little confused how it is supposed to work.

    The function returns POINTER TO STRING, but how do I get WSTRING?

    I succesfully used DynamicTextGetText with classical Strings.

    Thanks in advance!

     
  • TimvH

    TimvH - 2024-09-03

    First of all you need to enable "Use unicodestrings" in the Visualization Manager.

    This function returns a pointer to a WSTRING (not STRING).

    To get this wstring value, do something like this:
    VAR
    myWstringVariable : WSTRING(255);
    END_VAR
    myWstringVariable := myResult^; // this is dereferencing the pointer to the WSTRING.

     
  • thedertom - 2024-09-03

    Hi TimvH, thanks for your reply.

    Yes I got that figured out now.
    However: in "myWstringVariable" it will only store the first character of the text.
    How do I get the full text?

     

Log in to post a comment.