<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CHAR TO ListBox-&amp;gt;Items-&amp;gt;Add]]></title><description><![CDATA[<p>CHAR chOudput[100];<br />
sprintf(chOudput,&quot;%i %it&quot;,dwTest,dwTest2);<br />
listBox2-&gt;Items-&gt;Add(chOudput);</p>
<p>Error:<br />
error C2664: 'System::Windows::Forms::ListBox::ObjectCollection::Add': Konvertierung des Parameters 1 von 'CHAR [100]' in 'System::Object ^' nicht möglich<br />
Ursache: Konvertierung von 'CHAR *' in 'System::Object ^' nicht möglich<br />
Es ist kein benutzerdefinierter Konvertierungsoperator verfügbar, oder<br />
Ein nicht verwalteter Typ kann nicht in einen verwalteten Typ umgewandelt werden</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/301054/char-to-listbox-gt-items-gt-add</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 07:40:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/301054.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 18 Mar 2012 14:07:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CHAR TO ListBox-&amp;gt;Items-&amp;gt;Add on Sun, 18 Mar 2012 14:07:13 GMT]]></title><description><![CDATA[<p>CHAR chOudput[100];<br />
sprintf(chOudput,&quot;%i %it&quot;,dwTest,dwTest2);<br />
listBox2-&gt;Items-&gt;Add(chOudput);</p>
<p>Error:<br />
error C2664: 'System::Windows::Forms::ListBox::ObjectCollection::Add': Konvertierung des Parameters 1 von 'CHAR [100]' in 'System::Object ^' nicht möglich<br />
Ursache: Konvertierung von 'CHAR *' in 'System::Object ^' nicht möglich<br />
Es ist kein benutzerdefinierter Konvertierungsoperator verfügbar, oder<br />
Ein nicht verwalteter Typ kann nicht in einen verwalteten Typ umgewandelt werden</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2192521</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2192521</guid><dc:creator><![CDATA[BodyGangster1]]></dc:creator><pubDate>Sun, 18 Mar 2012 14:07:13 GMT</pubDate></item><item><title><![CDATA[Reply to CHAR TO ListBox-&amp;gt;Items-&amp;gt;Add on Sun, 18 Mar 2012 14:14:22 GMT]]></title><description><![CDATA[<pre><code class="language-cli">for ( int x = 1; x &lt;= 50; x++ )
{
   listBox1-&gt;Items-&gt;Add( String::Format( &quot;Item {0}&quot;, x ) );
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2192523</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2192523</guid><dc:creator><![CDATA[ZeroXCola]]></dc:creator><pubDate>Sun, 18 Mar 2012 14:14:22 GMT</pubDate></item><item><title><![CDATA[Reply to CHAR TO ListBox-&amp;gt;Items-&amp;gt;Add on Sun, 18 Mar 2012 14:18:45 GMT]]></title><description><![CDATA[<p>Du mischst C und C++/CLI (nicht C++, wie Du vielleicht glaubst).<br />
Daher - falsches Forum: C++/CLI wäre besser.<br />
Aber halt, lies das: <a href="http://www.c-plusplus.net/forum/263084" rel="nofollow">http://www.c-plusplus.net/forum/263084</a></p>
<p>Und konkret hilft vermutlich das:</p>
<pre><code class="language-cli">CHAR chOudput[100]; 
sprintf(chOudput,&quot;%i %it&quot;,dwTest,dwTest2); 
listBox2-&gt;Items-&gt;Add(gcnew System::String(chOudput));
</code></pre>
<p>(Ungetestet - sollte aber gehen.)</p>
<p>Und mit .NET macht &quot;man&quot; das eher so:</p>
<pre><code class="language-cli">listBox2-&gt;Items-&gt;Add(System::String::Format(&quot;{1} {2}&quot;, dwTest, dwTest2));
</code></pre>
<p>(Format-String ev. nicht 100% korrekt...)</p>
<p>Aber eben... lass die Finger von C++/CLI und belibe entweder nativ oder dann nimm C# oder <a href="http://VB.NET" rel="nofollow">VB.NET</a>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2192526</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2192526</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Sun, 18 Mar 2012 14:18:45 GMT</pubDate></item><item><title><![CDATA[Reply to CHAR TO ListBox-&amp;gt;Items-&amp;gt;Add on Sun, 18 Mar 2012 15:01:23 GMT]]></title><description><![CDATA[<p>listBox2-&gt;Items-&gt;Add(String::Format(&quot;{0}&quot;,dwHonk));</p>
<p>works but the oudput is: 8188281<br />
i want a hex oudput : 0x7CF179</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2192529</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2192529</guid><dc:creator><![CDATA[BodyGangster1]]></dc:creator><pubDate>Sun, 18 Mar 2012 15:01:23 GMT</pubDate></item><item><title><![CDATA[Reply to CHAR TO ListBox-&amp;gt;Items-&amp;gt;Add on Sun, 18 Mar 2012 15:13:18 GMT]]></title><description><![CDATA[<p>Check out the documentation:<br />
<a href="http://msdn.microsoft.com/en-us/library/system.string.format.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.string.format.aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2192531</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2192531</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Sun, 18 Mar 2012 15:13:18 GMT</pubDate></item><item><title><![CDATA[Reply to CHAR TO ListBox-&amp;gt;Items-&amp;gt;Add on Sun, 18 Mar 2012 15:14:25 GMT]]></title><description><![CDATA[<p>Check out the documentation:<br />
<a href="http://msdn.microsoft.com/en-us/library/system.string.format.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.string.format.aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2192533</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2192533</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Sun, 18 Mar 2012 15:14:25 GMT</pubDate></item></channel></rss>