<?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 Re: DGGetItemText() in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/DGGetItemText/m-p/178599#M5636</link>
    <description>Thanks Ralph for your response,&lt;BR /&gt;
&lt;BR /&gt;
So, I don't understand very well, the parameter "char* text" can be use like this ? :&lt;BR /&gt;
&lt;BR /&gt;
My old code (api 15) : &lt;BR /&gt;
&lt;BR /&gt;
char strPath[255];&lt;BR /&gt;
DGGetItemText(intIdFenetreActuelle,2,strPath,DGGetItemText(intIdFenetreActuelle,2,NULL,0));&lt;BR /&gt;
&lt;BR /&gt;
My new code (api 16) :&lt;BR /&gt;
&lt;BR /&gt;
char strPath[255];&lt;BR /&gt;
(GS::UniString)strPath = DGGetItemText(intIdFenetreActuelle,2);&lt;BR /&gt;
&lt;BR /&gt;
PS : I have simplified my code</description>
    <pubDate>Fri, 03 Aug 2012 09:59:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-08-03T09:59:50Z</dc:date>
    <item>
      <title>DGGetItemText()</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/DGGetItemText/m-p/178597#M5634</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I use Api DevKit 16 but the fonction DGGetItemText() doesn't have the same number of parameter than API DevKit 15.&lt;BR /&gt;&lt;BR /&gt;-&amp;gt; "DGGetItemText (short dialId, short item, char* text, Int32 size);"&lt;BR /&gt;&lt;BR /&gt;Do you know by what function it is replaced in API DevKit 16 ?&lt;BR /&gt;&lt;BR /&gt;I'm searching for...&lt;BR /&gt;&lt;BR /&gt;Thanks, Have a nice day.&lt;/DIV&gt;</description>
      <pubDate>Wed, 02 Aug 2023 14:22:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/DGGetItemText/m-p/178597#M5634</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-02T14:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: DGGetItemText()</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/DGGetItemText/m-p/178598#M5635</link>
      <description>&lt;BLOCKQUOTE&gt;atila-diffusion wrote:&lt;BR /&gt;-&amp;gt; "DGGetItemText (short dialId, short item, char* text, Int32 size);"&lt;BR /&gt;
Do you know by what function it is replaced in API DevKit 16 ?&lt;/BLOCKQUOTE&gt;
It hasn't been replaced, just modified. The old method was a bit antiquated, relying on a caller-specified buffer. If the text content exceeded the buffer, the user's input would be truncated. The AC16 version is:&lt;PRE&gt;DG_DLL_EXPORT GS::UniString CCALL	DGGetItemText (short dialId, short item);&lt;/PRE&gt;
This function simply returns a dynamic, Unicode string containing the full user input.</description>
      <pubDate>Thu, 02 Aug 2012 22:49:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/DGGetItemText/m-p/178598#M5635</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2012-08-02T22:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: DGGetItemText()</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/DGGetItemText/m-p/178599#M5636</link>
      <description>Thanks Ralph for your response,&lt;BR /&gt;
&lt;BR /&gt;
So, I don't understand very well, the parameter "char* text" can be use like this ? :&lt;BR /&gt;
&lt;BR /&gt;
My old code (api 15) : &lt;BR /&gt;
&lt;BR /&gt;
char strPath[255];&lt;BR /&gt;
DGGetItemText(intIdFenetreActuelle,2,strPath,DGGetItemText(intIdFenetreActuelle,2,NULL,0));&lt;BR /&gt;
&lt;BR /&gt;
My new code (api 16) :&lt;BR /&gt;
&lt;BR /&gt;
char strPath[255];&lt;BR /&gt;
(GS::UniString)strPath = DGGetItemText(intIdFenetreActuelle,2);&lt;BR /&gt;
&lt;BR /&gt;
PS : I have simplified my code</description>
      <pubDate>Fri, 03 Aug 2012 09:59:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/DGGetItemText/m-p/178599#M5636</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-03T09:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: DGGetItemText()</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/DGGetItemText/m-p/178600#M5637</link>
      <description>&lt;BLOCKQUOTE&gt;atila-diffusion wrote:&lt;BR /&gt;My new code (api 16) :&lt;BR /&gt;
char strPath[255];&lt;BR /&gt;
(GS::UniString)strPath = DGGetItemText(intIdFenetreActuelle,2);&lt;/BLOCKQUOTE&gt;
No, it's much simpler than that:&lt;PRE&gt;GS::UniString strPath = DGGetItemText(intIdFenetreActuelle, 2);&lt;/PRE&gt;
If you really need a const char* you can request a C-string representation of the string data by calling the following method:&lt;PRE&gt;const char* strPathCStr = strPath.ToCStr();&lt;/PRE&gt;
But ideally you should use a string class and not delve into the raw data if at all possible. You avoid all the risk of buffer overruns etc.</description>
      <pubDate>Fri, 03 Aug 2012 10:38:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/DGGetItemText/m-p/178600#M5637</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2012-08-03T10:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: DGGetItemText()</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/DGGetItemText/m-p/178601#M5638</link>
      <description>Thank you so much Ralph ! &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt;</description>
      <pubDate>Fri, 03 Aug 2012 11:51:33 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/DGGetItemText/m-p/178601#M5638</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-03T11:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: DGGetItemText()</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/DGGetItemText/m-p/178602#M5639</link>
      <description>&lt;BLOCKQUOTE&gt;Ralph wrote:&lt;BR /&gt;
If you really need a const char* you can request a C-string representation of the string data by calling the following method:&lt;PRE&gt;const char* strPathCStr = strPath.ToCStr();&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;

Be careful with that, though. Don't keep the pointer (strPathCStr above) around, just use it to copy the C string representation elsewhere.&lt;BR /&gt;
Also, you can pass a code page (in the form of the CC_xxx constants, see CH.hpp) to extract the string in a different codepage (e.g. UTF8).&lt;BR /&gt;
&lt;BR /&gt;
Best, Akos</description>
      <pubDate>Wed, 08 Aug 2012 14:16:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/DGGetItemText/m-p/178602#M5639</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2012-08-08T14:16:04Z</dc:date>
    </item>
  </channel>
</rss>

