<?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: passing string to custom objects through a managed wrapper in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4674793#M13034</link>
    <description>&lt;P&gt;Thanks AGAIN for the push.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not even kinda kidding, there are tears in my eyes right now;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my co-workers couldn't take anymore swearing either &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Dec 2013 05:58:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-12-05T05:58:55Z</dc:date>
    <item>
      <title>passing string to custom objects through a managed wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4668155#M13031</link>
      <description>&lt;P&gt;I'm working on a mixed code project - Custom DBX objects wrapped and used in vb.net, ala polysamp or even simplesquare examples.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got most things going good - lot of work but still, it's going. oddly one of the harder things to do is pass string data into the wrapper due to the curse of unicode. &amp;nbsp;I'm sure there is a way to do this (i've seen the StringToWchar and WcharToString functions but failed to get use out of them).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyhow anyone got advice on this? I'll put all the (relavent) code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The variable in the custom object class:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;const wchar_t* m_Suburb;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the get / set declarations in the class:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;std::string getSuburb();&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Acad::ErrorStatus setSuburb(std::string Suburb);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and [my attempts at] the definitions for them:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;std::string SectionObject::getSuburb()&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;std::wstring ws;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ws = m_Suburb;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;std::string str(ws.begin(),ws.end());&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;return str;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Acad::ErrorStatus SectionObject::setSuburb(std::string Suburb )&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;std::wstring widestr = std::wstring(Suburb.begin(), Suburb.end());&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;const wchar_t* widecstr = widestr.c_str();&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;m_Suburb=widecstr;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;return Acad::eOk;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the declaration for the wrapper of the property:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;property std::string Suburb&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;std::string get ();&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;void set(std::string suburb);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...the definition of the wrapper:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;std::string BCHF::SectionObjectWrap::mgSectionObject::Suburb::get()&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;return (GetImpObj()-&amp;gt;getSuburb());&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void BCHF::SectionObjectWrap::mgSectionObject::Suburb::set(std::string value)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Autodesk::AutoCAD::Runtime::Interop::Check(GetImpObj()-&amp;gt;setSuburb(value));&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the only other relavent thing is the initialization in the constructor:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SectionObject::SectionObject () : m_SectNumber(1)&lt;BR /&gt;,&lt;STRONG&gt; m_Suburb(_T("s"))&lt;/STRONG&gt;//&amp;lt;- here is the init for string - this i'm really making up, no idea how to initialize a wchar....&lt;BR /&gt;, m_ShowSectNumber(false)&lt;BR /&gt;, m_ShowArea(false)&lt;BR /&gt;, m_TxtMspace(0,0,0)&lt;BR /&gt;, m_TxtSizeMspace(0.0)&lt;BR /&gt;, m_Normal(0,0,1)&lt;BR /&gt;, m_pManaged(NULL) {&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;anyone else been here? I can't find much discussion about this, so any ideas appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;oh, and is there anyone to disable these smiley faces in code snippets?!?!? lol.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2013 00:31:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4668155#M13031</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-03T00:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: passing string to custom objects through a managed wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4674509#M13032</link>
      <description>&lt;P&gt;ok...thanks to Balaji I've got a start - PolySamp has it burried in there &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now.... When I try to USE the polysamp example, it gives me grief. Largely (I suspect) because I modeled after SimpleSquare originally.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm being told this notation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;__property void set_Name(String* value);&lt;BR /&gt;__property String* get_Name();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is illegal in visual studio - and when I try to adapt polysamp to :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;property String* Suburb&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;String* get ();&lt;BR /&gt;void set( String* suburb);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;I get a bunch of:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;"an ordinary pointer to a c++/cli reference is not aloud"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wah. I was so close.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;I'm also getting a lot of errors on&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="line-height: 15px;"&gt;StringToCIF and CIFToString -&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;but one thing at a time....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i noticed that the declarations have a "ref" in simple square class and a "__gc" in Polysamp - maybe this is the diffence, no idea.&lt;/P&gt;&lt;P&gt;I had the whole thing working with the old notation - I'm looking at re-writing the whole thing to pass a string?!? there has to be an eaiser way :S&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2013 00:34:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4674509#M13032</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-05T00:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: passing string to custom objects through a managed wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4674789#M13033</link>
      <description>&lt;P&gt;Hi Carl,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Polysamp SDK sample uses the old CLR syntax.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can find the changes to migrate it to the new clr syntax here :&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/b23b94s7(v=vs.90).aspx" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/b23b94s7(v=vs.90).aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From that article, you can find that the String* is to be replace with String^&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 14px; line-height: 15px;"&gt;I have attached the SimpleSquare sample with the changes to pass a String. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 14px; line-height: 15px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 14px; line-height: 15px;"&gt;I have only verified that it builds ok. I haven't tested it, so please do let me know if there is a problem and if does not work.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 14px; line-height: 15px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 14px; line-height: 15px;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 14px; line-height: 15px;"&gt;Balaji&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2013 05:57:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4674789#M13033</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2013-12-05T05:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: passing string to custom objects through a managed wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4674793#M13034</link>
      <description>&lt;P&gt;Thanks AGAIN for the push.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not even kinda kidding, there are tears in my eyes right now;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my co-workers couldn't take anymore swearing either &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2013 05:58:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4674793#M13034</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-05T05:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: passing string to custom objects through a managed wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4674821#M13035</link>
      <description>&lt;P&gt;Sorry for the trouble. I am glad you have a sample to work on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both the samples, SimpleSquare and PolySamp are examples which were originally implemented using the Old CLR syntax. I migrated the SimpleSquare to use the new CLR syntax and post it in the ADN Devblog. But the Polysamp is not yet migrated and continues to use the old CLR syntax. So this can cause some trouble when portions from the managed wrapper of Polysamp are used.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The MSDN link that I posted earlier should be a helpful reference in case you need to migrate such code in future.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Balaji&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2013 06:14:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4674821#M13035</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2013-12-05T06:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: passing string to custom objects through a managed wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4676653#M13036</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;Sorry for the trouble. I am glad you have a sample to work on."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;lol very very true. while uh...a bit...out of date, without the samples these projects would simply be impossible. A collegue of mine and I were actually joking the other day about what these projects would be like without internet access...But I digress.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While I'm &lt;EM&gt;absolutely giving Balaji 100% credit for this save/solution&lt;/EM&gt;, I'm going to post the final working syntax [that compiled for &lt;STRONG&gt;me&lt;/STRONG&gt;. I haven't tested it much yet]&amp;nbsp;here and flag it as the solution to help any other weary travellers in the future.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So here it is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//the string internal variable declaration in your custom class:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;TCHAR* &amp;nbsp;myPassedString;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;//the get / set function declarations in your custom class:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;const TCHAR* getMy&lt;SPAN&gt;PassedString&lt;/SPAN&gt;() const;&lt;BR /&gt;Acad::ErrorStatus setM&lt;SPAN&gt;yPassedString&lt;/SPAN&gt;(const TCHAR* &lt;SPAN&gt;myPassedString&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//the get / set function definitions in your custom class:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;const TCHAR* &lt;SPAN&gt;myCustomClass&lt;/SPAN&gt;::&lt;SPAN&gt;getMy&lt;/SPAN&gt;PassedString() const&lt;BR /&gt;{&lt;BR /&gt;assertReadEnabled();&lt;BR /&gt;return &lt;SPAN&gt;myPassedString&lt;/SPAN&gt;;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Acad::ErrorStatus myCustomClass::&lt;SPAN&gt;setM&lt;/SPAN&gt;yPassedString(const TCHAR* value)&lt;BR /&gt;{&lt;BR /&gt;assertWriteEnabled();&lt;/P&gt;&lt;P&gt;acutDelString(&lt;SPAN&gt;myPassedString&lt;/SPAN&gt;);&lt;BR /&gt;&lt;SPAN&gt;myPassedString&lt;/SPAN&gt;= NULL;&lt;/P&gt;&lt;P&gt;if(value!= NULL)&lt;BR /&gt;{&lt;BR /&gt;acutUpdString(value, &lt;SPAN&gt;myPassedString&lt;/SPAN&gt;);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return Acad::eOk;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/*HERE IS THE TRICKY BIT!!!! The Declaration for the Wrapper for the Custom Object&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;//&amp;gt;&amp;gt;&amp;gt;&amp;gt;pay attention to the new property notation, and that ^ has replaced the spots you would expect a *. &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;//in a way it was staring me in the face from:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;// &amp;nbsp; &amp;nbsp;void add (SectionModifiedHandler^);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;// but things like this in the wrapper:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;// &amp;nbsp; &amp;nbsp;inline SectionObject* &amp;nbsp;GetImpObj()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// do seem inconsistent...also the .NetWrapper Wizard uses the depreciated, and in VS2012, killed __property notation.&lt;/P&gt;&lt;P&gt;// it won't work in 2012 but seems to be working in 2010 in the sample - 2012 never even liked opening PolySamp at all -&lt;/P&gt;&lt;P&gt;// probably due to the removal of free "installers" from the Visual Studio suite.*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;property String^ MyPassedString&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;String^ get();&lt;BR /&gt;void set(String^ value);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//the definition for the Wrapper:&lt;/P&gt;&lt;P&gt;//get&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;String^ ADSY::ClassWrapNamespace::&lt;SPAN&gt;myCustomClass&lt;/SPAN&gt;::&lt;/SPAN&gt;MyPassedString&lt;SPAN&gt;::get()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return CIFToString(GetImpObj()-&amp;gt;getMy&lt;SPAN&gt;PassedString&lt;/SPAN&gt;());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;//set&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 15px;"&gt;void &lt;SPAN&gt;ADSY&lt;/SPAN&gt;::&lt;SPAN&gt;ClassWrapNamespace&lt;/SPAN&gt;::&lt;SPAN&gt;myCustomClass&lt;/SPAN&gt;::&lt;SPAN&gt;MyPassedString&lt;/SPAN&gt;::set(String^ value)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;Autodesk::AutoCAD::Runtime::Interop::Check(GetImpObj()-&amp;gt;setM&lt;SPAN&gt;yPassedString&lt;/SPAN&gt;(StringToCIF(value)));&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;__________________________________________________________________________________________________________&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've just included the relavent things to passing strings, and the class/variable names I've changed to make everything more clear... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; hope that helps someone.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2013 21:33:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4676653#M13036</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-05T21:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: passing string to custom objects through a managed wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4677335#M13037</link>
      <description>&lt;P&gt;You don't need acutDelString() or the other gymnastics. The acedUpdString() function&amp;nbsp;already does that for you.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2013 08:14:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4677335#M13037</guid>
      <dc:creator>owenwengerd</dc:creator>
      <dc:date>2013-12-06T08:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: passing string to custom objects through a managed wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4680957#M13038</link>
      <description>&lt;P&gt;I'm happy to ammend it... a lot of what I'm reading seems outdated, but just to clarify, from the dev handbook begining, tips and techniques (and the sample itself):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="Element15"&gt;&lt;STRONG&gt;Freeing Strings Returned as Non-const Pointers&lt;/STRONG&gt;&lt;/DIV&gt;&lt;P class="Element10"&gt;When calling methods that return non-&lt;SPAN&gt;const&lt;/SPAN&gt; string pointers (for example, &lt;SPAN&gt;AcDbSymbolTable::getName(char&amp;amp;* pName)&lt;/SPAN&gt;), you should free the memory occupied by the returned string. For example:&lt;/P&gt;&lt;P class="Element10"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;EM&gt;&lt;SPAN&gt;// The getName() call should be followed by a call to&lt;/SPAN&gt;&lt;/EM&gt;
acutDelString(pLtName);pLtTableRcd-&amp;gt;getName(pLtName);
&lt;EM&gt;&lt;SPAN&gt;// ... other code&lt;/SPAN&gt;&lt;/EM&gt;
acutDelString(pLtName);&lt;/PRE&gt;&lt;P class="Element10"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="Element10"&gt;so is that wrong now or just fluff...?&lt;/P&gt;</description>
      <pubDate>Sun, 08 Dec 2013 23:49:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4680957#M13038</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-08T23:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: passing string to custom objects through a managed wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4681083#M13039</link>
      <description>&lt;P&gt;Hi Carl,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is also an overload that uses AcString which is more convenient to use.&lt;/P&gt;
&lt;P&gt;There is no need to cleanup if you create an AcString instance on the stack.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Balaji&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2013 04:38:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4681083#M13039</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2013-12-09T04:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: passing string to custom objects through a managed wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4681169#M13040</link>
      <description>AcString versions are indeed somewhat more convenient but beware that there is a bug in AcString version of AcDbBlockTableRecord::getName (see &lt;A href="http://forums.autodesk.com/t5/Autodesk-ObjectARX/AcDbBlockTableRecord-getName-two-signatures-different-results/td-p/4598345)" target="_blank"&gt;http://forums.autodesk.com/t5/Autodesk-ObjectARX/AcDbBlockTableRecord-getName-two-signatures-different-results/td-p/4598345)&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;My two cents</description>
      <pubDate>Mon, 09 Dec 2013 05:56:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4681169#M13040</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-09T05:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: passing string to custom objects through a managed wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4681357#M13041</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;so is that wrong now or just fluff...?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I don't see any problem with that sample code; my comment applies only&amp;nbsp;to your code.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2013 09:04:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4681357#M13041</guid>
      <dc:creator>owenwengerd</dc:creator>
      <dc:date>2013-12-09T09:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: passing string to custom objects through a managed wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4682935#M13042</link>
      <description>&lt;P&gt;I'm getting a bad url link there?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2013 23:16:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4682935#M13042</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-09T23:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: passing string to custom objects through a managed wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4683639#M13043</link>
      <description>&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/Autodesk-ObjectARX/AcDbBlockTableRecord-getName-two-signatures-different-results/td-p/4598345" target="_self"&gt;here is the link&lt;/A&gt;, sorry&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2013 09:25:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4683639#M13043</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-10T09:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: passing string to custom objects through a managed wrapper</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4685437#M13044</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually your doing &lt;EM&gt;me&lt;/EM&gt; the favor, so no apology needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2013 22:26:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/passing-string-to-custom-objects-through-a-managed-wrapper/m-p/4685437#M13044</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-12-10T22:26:48Z</dc:date>
    </item>
  </channel>
</rss>

