<?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[Erzeugen von String Literale]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe eine Funktion von SQL vorgegeben die als Parameter nur ein:</p>
<p>SQLWCHAR* &lt;===(typedef wchar_t SQLWCHAR)</p>
<p>akzeptiert.</p>
<pre><code>//ERROR (pstrCmd ist vom typ const char*)
wchar_t* test = (wchar_t*)pstrCmd; // L&quot;Use Sakila;&quot;
_retcode = SQLExecDirect(m_mapDestination[ucDestination], (SQLWCHAR*)test, SQL_NTS);

//SUCCESS
wchar_t* test = (wchar_t*)L&quot;Use Sakila;&quot;;
_retcode = SQLExecDirect(m_mapDestination[ucDestination], (SQLWCHAR*)test, SQL_NTS);

//SUCCESS
_retcode = SQLExecDirect(m_mapDestination[ucDestination], (SQLWCHAR*)L&quot;Use Sakila;&quot;, SQL_NTS);
</code></pre>
<p>Ich möchte aber gerne Variante 1 zum laufen kriegen damit man über die Konsole Sql-Statements ausführen kann.</p>
<p>Es scheint ein Problem damit zu geben, dass das L beim casten nicht erzeugt wird.</p>
<p>Hat jemand eine Idee?</p>
<p>cuanu</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/335284/erzeugen-von-string-literale</link><generator>RSS for Node</generator><lastBuildDate>Fri, 24 Apr 2026 19:36:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/335284.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 11 Nov 2015 13:04:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Erzeugen von String Literale on Wed, 11 Nov 2015 13:04:11 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe eine Funktion von SQL vorgegeben die als Parameter nur ein:</p>
<p>SQLWCHAR* &lt;===(typedef wchar_t SQLWCHAR)</p>
<p>akzeptiert.</p>
<pre><code>//ERROR (pstrCmd ist vom typ const char*)
wchar_t* test = (wchar_t*)pstrCmd; // L&quot;Use Sakila;&quot;
_retcode = SQLExecDirect(m_mapDestination[ucDestination], (SQLWCHAR*)test, SQL_NTS);

//SUCCESS
wchar_t* test = (wchar_t*)L&quot;Use Sakila;&quot;;
_retcode = SQLExecDirect(m_mapDestination[ucDestination], (SQLWCHAR*)test, SQL_NTS);

//SUCCESS
_retcode = SQLExecDirect(m_mapDestination[ucDestination], (SQLWCHAR*)L&quot;Use Sakila;&quot;, SQL_NTS);
</code></pre>
<p>Ich möchte aber gerne Variante 1 zum laufen kriegen damit man über die Konsole Sql-Statements ausführen kann.</p>
<p>Es scheint ein Problem damit zu geben, dass das L beim casten nicht erzeugt wird.</p>
<p>Hat jemand eine Idee?</p>
<p>cuanu</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2474979</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2474979</guid><dc:creator><![CDATA[cuanuriaq]]></dc:creator><pubDate>Wed, 11 Nov 2015 13:04:11 GMT</pubDate></item><item><title><![CDATA[Reply to Erzeugen von String Literale on Wed, 11 Nov 2015 13:23:19 GMT]]></title><description><![CDATA[<p>Hallo.</p>
<p>Wie wäre es mit einer Konvertierung von char* nach <strong>w</strong>char_t* ?<br />
Es findet keine Konvertierung statt, in dem Du es hart auf den Typ wchar_t änderst!</p>
<pre><code>const wchar_t *GetWC(const char *c)
{
    const size_t cSize = strlen(c)+1;
    wchar_t* wc = new wchar_t[cSize];
    mbstowcs (wc, c, cSize);

    return wc;
}
</code></pre>
<p>Quelle: <a href="http://stackoverflow.com/questions/8032080/how-to-convert-char-to-wchar-t" rel="nofollow">http://stackoverflow.com/questions/8032080/how-to-convert-char-to-wchar-t</a></p>
<p>Viele Grüße,</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2474982</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2474982</guid><dc:creator><![CDATA[jb2603]]></dc:creator><pubDate>Wed, 11 Nov 2015 13:23:19 GMT</pubDate></item><item><title><![CDATA[Reply to Erzeugen von String Literale on Wed, 11 Nov 2015 13:26:45 GMT]]></title><description><![CDATA[<p>cuanuriaq schrieb:</p>
<blockquote>
<p>Ich möchte aber gerne Variante 1 zum laufen kriegen damit man über die Konsole Sql-Statements ausführen kann.</p>
</blockquote>
<p>Dann benutze wcin und wstring. Mit C-Style gecaste kommst du nicht weiter.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2474983</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2474983</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Wed, 11 Nov 2015 13:26:45 GMT</pubDate></item></channel></rss>