<?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[BSTR in char[] oder CString (COM) und umgekehrt]]></title><description><![CDATA[<p>(VC++ 6.0 SP5)</p>
<p>Hallo,</p>
<p>ich habe im Moment ein Problem:</p>
<p>Ich habe ein paar Funktionen, deren Übergabeparameter BSTR sind<br />
(STDMETHODIMP Foobar::getFoobar(BSTR str);) und auf der anderen Seite ein Paar, die diese Funktionen nutzen. Ich bekomme aber ein BSTR/_bstr_t nicht in char [] oder CString und umgekehrt. Die Konstruktoren von _bstr_t sind zwar gut, helfen aber mir nicht weiter. BSTR ist aber wichtiger.</p>
<p>Am besten waere so eine funktion wie sprintf(mein_bstr, &quot;wert %s %d&quot;, string, integer); oder CString::Format(..);</p>
<p>Weiß da jemand was?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/75469/bstr-in-char-oder-cstring-com-und-umgekehrt</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 11:45:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/75469.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 01 Jun 2004 07:23:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to BSTR in char[] oder CString (COM) und umgekehrt on Tue, 01 Jun 2004 07:23:19 GMT]]></title><description><![CDATA[<p>(VC++ 6.0 SP5)</p>
<p>Hallo,</p>
<p>ich habe im Moment ein Problem:</p>
<p>Ich habe ein paar Funktionen, deren Übergabeparameter BSTR sind<br />
(STDMETHODIMP Foobar::getFoobar(BSTR str);) und auf der anderen Seite ein Paar, die diese Funktionen nutzen. Ich bekomme aber ein BSTR/_bstr_t nicht in char [] oder CString und umgekehrt. Die Konstruktoren von _bstr_t sind zwar gut, helfen aber mir nicht weiter. BSTR ist aber wichtiger.</p>
<p>Am besten waere so eine funktion wie sprintf(mein_bstr, &quot;wert %s %d&quot;, string, integer); oder CString::Format(..);</p>
<p>Weiß da jemand was?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/530659</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/530659</guid><dc:creator><![CDATA[lazydot]]></dc:creator><pubDate>Tue, 01 Jun 2004 07:23:19 GMT</pubDate></item><item><title><![CDATA[Reply to BSTR in char[] oder CString (COM) und umgekehrt on Tue, 01 Jun 2004 08:36:42 GMT]]></title><description><![CDATA[<p>CString:AllocSysString<br />
CString::SetSysString</p>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/530705</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/530705</guid><dc:creator><![CDATA[CMatt]]></dc:creator><pubDate>Tue, 01 Jun 2004 08:36:42 GMT</pubDate></item><item><title><![CDATA[Reply to BSTR in char[] oder CString (COM) und umgekehrt on Tue, 01 Jun 2004 08:40:46 GMT]]></title><description><![CDATA[<p>CMatt schrieb:</p>
<blockquote>
<p>CString:AllocSysString<br />
CString::SetSysString</p>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
</blockquote>
<p>Danke, probiere das gleich aus..<br />
habe gerade noch A2BSTR getestet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/530709</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/530709</guid><dc:creator><![CDATA[lazydot]]></dc:creator><pubDate>Tue, 01 Jun 2004 08:40:46 GMT</pubDate></item><item><title><![CDATA[Reply to BSTR in char[] oder CString (COM) und umgekehrt on Tue, 01 Jun 2004 09:47:50 GMT]]></title><description><![CDATA[<p>Ich habe noch eine Frage: _com_error to CString/BSTR/_bstr_t/char[] --&gt; irgendwas.</p>
<p>Und noch eine:</p>
<pre><code>#include &lt;ANSIAPI.H&gt;
#include &lt;comdef.h&gt;
_bstr_t bsText(&quot;Hai Bayram&quot;);
CString strName;
W2A(bsText, strName.GetBuffer(256), 256);
strName.ReleaseBuffer();
AfxMessageBox(strName);

// Wozu ist diese GetModuleFileName Funktion hier??
char szFileName[256];
GetModuleFileName(NULL,szFileName,256);
AfxMessageBox(szFileName);
</code></pre>
<p>Dieses Beispiel soll nur _bstr_t to CString zeigen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/530762</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/530762</guid><dc:creator><![CDATA[lazydot]]></dc:creator><pubDate>Tue, 01 Jun 2004 09:47:50 GMT</pubDate></item></channel></rss>