<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic LibXL - How to convert GS::UniString to wchar_t *? in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/LibXL-How-to-convert-GS-UniString-to-wchar-t/m-p/289311#M2992</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm looking at the Database_Control example for Archicad 23 and I see that the example shows using a define to convert:
&lt;PRE&gt; UNISTR_TO_LIBXLSTR(str) (str.ToUstr ()) &lt;/PRE&gt;
, however I cannot get the example or my own project to build when following this code. I get an error that
&lt;PRE&gt;no suitable conversion function from "GS::UniString::UStr" to "const wchar_t *" existsC/C++(413)&lt;/PRE&gt;
, is this example not up to date or is there some other way to convert the GS::UniString to the correct type for the excel library?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/DIV&gt;</description>
    <pubDate>Tue, 14 Sep 2021 11:42:50 GMT</pubDate>
    <dc:creator>cfranklin</dc:creator>
    <dc:date>2021-09-14T11:42:50Z</dc:date>
    <item>
      <title>LibXL - How to convert GS::UniString to wchar_t *?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/LibXL-How-to-convert-GS-UniString-to-wchar-t/m-p/289311#M2992</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm looking at the Database_Control example for Archicad 23 and I see that the example shows using a define to convert:
&lt;PRE&gt; UNISTR_TO_LIBXLSTR(str) (str.ToUstr ()) &lt;/PRE&gt;
, however I cannot get the example or my own project to build when following this code. I get an error that
&lt;PRE&gt;no suitable conversion function from "GS::UniString::UStr" to "const wchar_t *" existsC/C++(413)&lt;/PRE&gt;
, is this example not up to date or is there some other way to convert the GS::UniString to the correct type for the excel library?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 11:42:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/LibXL-How-to-convert-GS-UniString-to-wchar-t/m-p/289311#M2992</guid>
      <dc:creator>cfranklin</dc:creator>
      <dc:date>2021-09-14T11:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: LibXL - How to convert GS::UniString to wchar_t *?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/LibXL-How-to-convert-GS-UniString-to-wchar-t/m-p/289312#M2993</link>
      <description>Which compiler, version and toolset are you using?</description>
      <pubDate>Mon, 19 Oct 2020 19:38:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/LibXL-How-to-convert-GS-UniString-to-wchar-t/m-p/289312#M2993</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2020-10-19T19:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: LibXL - How to convert GS::UniString to wchar_t *?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/LibXL-How-to-convert-GS-UniString-to-wchar-t/m-p/289313#M2994</link>
      <description>I was able to convert a UniString to a wstring in C++ using:&lt;BR /&gt;
&lt;BR /&gt;
(str is a GS::UniString)&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;GS::UniChar::Layout* valptr = str.CopyUStr(0, str.GetLength());
wstring endstr;
for (int j = 0; j &amp;lt; str.GetLength(); j++) {
		wchar_t temp = wchar_t(*(valptr + j));
		endstr += temp;
}
&lt;/PRE&gt;

I basically had to loop through it using pointers and convert each character. There's probably a better way to do this though.</description>
      <pubDate>Wed, 04 Nov 2020 18:17:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/LibXL-How-to-convert-GS-UniString-to-wchar-t/m-p/289313#M2994</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-04T18:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: LibXL - How to convert GS::UniString to wchar_t *?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/LibXL-How-to-convert-GS-UniString-to-wchar-t/m-p/289314#M2995</link>
      <description>If it works in one of the example projects, it should work for everyone. If it doesn't, it suggests a compiler version or toolkit outside the range specified by GS is being used. If you want a real answer, it would be useful to know which compiler, version and toolset are you using.</description>
      <pubDate>Thu, 05 Nov 2020 09:24:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/LibXL-How-to-convert-GS-UniString-to-wchar-t/m-p/289314#M2995</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2020-11-05T09:24:32Z</dc:date>
    </item>
  </channel>
</rss>

