<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to CharBufferString - Initialize from a WString</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/211d4e9b69/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/211d4e9b69/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/211d4e9b69/</id><updated>2022-07-20T12:51:28.650000Z</updated><subtitle>Recent posts to CharBufferString - Initialize from a WString</subtitle><entry><title>CharBufferString - Initialize from a WString</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/211d4e9b69/?limit=25#86ad" rel="alternate"/><published>2022-07-20T12:51:28.650000Z</published><updated>2022-07-20T12:51:28.650000Z</updated><author><name>johndoe67</name><uri>https://forge.codesys.com/u/johndoe67/</uri></author><id>https://forge.codesys.comeb0966403476868b68cdb50bb47e435d95d975c2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Ok, thanks for the quick feedback&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CharBufferString - Initialize from a WString</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/211d4e9b69/?limit=25#c21e" rel="alternate"/><published>2022-07-20T11:57:09.238000Z</published><updated>2022-07-20T11:57:09.238000Z</updated><author><name>stmos</name><uri>https://forge.codesys.com/u/stmos/</uri></author><id>https://forge.codesys.com535e84b398ec728e0a5adf00a576e59786b47cf3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
I'm sorry, but no... I don't have a sample project at the moment. I'm not even  really an expert with the CharBufferString... 😢&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CharBufferString - Initialize from a WString</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/211d4e9b69/?limit=25#d8f9" rel="alternate"/><published>2022-07-20T06:31:46.054000Z</published><updated>2022-07-20T06:31:46.054000Z</updated><author><name>johndoe67</name><uri>https://forge.codesys.com/u/johndoe67/</uri></author><id>https://forge.codesys.com8e4a49ab214a38520cb0457221052b70c2aaa9ba</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello stmos,&lt;br/&gt;
I just start to work with the CharBufferString. Do you maybe have a simple example project to understand how it works?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CharBufferString - Initialize from a WString</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/211d4e9b69/?limit=25#5034" rel="alternate"/><published>2020-11-12T11:07:00.274000Z</published><updated>2020-11-12T11:07:00.274000Z</updated><author><name>sgronchi</name><uri>https://forge.codesys.com/u/sgronchi/</uri></author><id>https://forge.codesys.com1744e4c11eedffaab7367c0caaa8a56ba4a9bf47</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;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.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CharBufferString - Initialize from a WString</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/211d4e9b69/?limit=25#bedc" rel="alternate"/><published>2020-11-12T09:40:32.648000Z</published><updated>2020-11-12T09:40:32.648000Z</updated><author><name>stmos</name><uri>https://forge.codesys.com/u/stmos/</uri></author><id>https://forge.codesys.com9879907fca775a3c764c8012f115d6b7a1ecfebc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;br/&gt;
I can't find a way to initialize a CharBufferString from a WString.&lt;/p&gt;
&lt;p&gt;I've done something similar for a STRING:&lt;/p&gt;
&lt;p&gt;Declaration:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;    &lt;span class="nt"&gt;astring&lt;/span&gt;     &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;STRING&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;1000&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="nt"&gt;cbs&lt;/span&gt;         &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;Stu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CharBufferString&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;uiBufferSize&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;2000&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;stringType&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;__SYSTEM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;TYPE_CLASS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;TYPE_STRING&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="nt"&gt;pst&lt;/span&gt;         &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;POINTER&lt;/span&gt; &lt;span class="nt"&gt;TO&lt;/span&gt; &lt;span class="nt"&gt;STRING&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Code:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;astring&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="s1"&gt;'... a very long string ...'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;cbs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;FromString&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;astring&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nt"&gt;pst&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;cbs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;m_cbpBuffer&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;But I can't find a "FromString" method that takes a WSTRING.&lt;br/&gt;
Any idea?&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>