CharBufferString - Initialize from a WString

stmos
2020-11-12
2020-11-12
  • stmos

    stmos - 2020-11-12

    Hello,
    I can't find a way to initialize a CharBufferString from a WString.

    I've done something similar for a STRING:

    Declaration:

        astring     : STRING(1000);
        cbs         : Stu.CharBufferString(uiBufferSize:=2000, stringType:=__SYSTEM.TYPE_CLASS.TYPE_STRING);
        pst         : POINTER TO STRING;
    

    Code:

    astring:='... a very long string ...';
    cbs.FromString(astring);
    pst := cbs.m_cbpBuffer;
    

    But I can't find a "FromString" method that takes a WSTRING.
    Any idea?

    Thanks in advance.

     
  • sgronchi

    sgronchi - 2020-11-12

    You need to use the method Initialize passing the pointer to the WSTRING and the proper __SYSTEM.TYPE_CLASS, i.e __SYSTEM.TYPE_CLASS.TYPE_WSTRING.

     

Log in to post a comment.