<?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[Tutorial von win-api.de]]></title><description><![CDATA[<p>Hallo erstmal ich wollte euch mal von einem Fehler berichten, der bei mir aufgetreten ist.<br />
Zuerst: Ich nutze Microsoft Visual C++ 2008 Express Edition und das Tut von win - api .de / das erste WinAPI Programm.<br />
Ich erhalte folgenden Fehler :</p>
<pre><code>error C2664: 'MessageBoxW': Konvertierung des Parameters 2 von 'const char [137]' in 'LPCWSTR' nicht möglich
</code></pre>
<p>bei folgendem Code:</p>
<pre><code class="language-cpp">#define STRICT
#include &lt;iostream&gt;
#include &lt;windows.h&gt;

const char  szWitz[] = &quot;\&quot;Ich steh' schwer auf Umweltschutz\&quot;, sagt Peter.\n&quot;
                       &quot;\&quot;Ich werfe zum Beispiel alte U-Bahn-Fahrscheine nie weg,\n&quot;
                       &quot;sondern benutze sie mehrmals.\&quot;&quot;;

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PSTR szCmdLine, int iCmdShow)
{

 int iAntwort = MessageBox(NULL, szWitz, &quot;Ha, ha, ha, ha...&quot;,
                                   MB_ICONINFORMATION | MB_OKCANCEL | MB_DEFBUTTON1);

if (IDOK == iAntwort)
   {
      MessageBox(NULL, &quot;Ja, ich finde den Witz auch Ok...&quot;,
                       &quot;Sie haben auf Ok gedrückt&quot;,
                       MB_ICONINFORMATION | MB_OK | MB_DEFBUTTON1);
   }

else if (IDCANCEL == iAntwort)
   {
      MessageBox(NULL, &quot;Ja, warum haben sie denn auf Abbrechen gedrückt?\n&quot;
                       &quot;Hat ihnen der Witz etwa nicht gefallen?&quot;,
                       &quot;Sie haben auf Abbrechen gedrückt&quot;,
                       MB_ICONINFORMATION  | MB_OK | MB_DEFBUTTON1);
   }

    return 0;
}
</code></pre>
<p>Der Fehler tritt drei mal in den Zeilen : 15, 22, 31 auf.<br />
Ich hoffe ihr könnt mir sagen was ich falsch gemacht habe.<br />
Euer Hihi</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/209421/tutorial-von-win-api-de</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 11:58:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/209421.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 30 Mar 2008 15:54:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Tutorial von win-api.de on Sun, 30 Mar 2008 15:54:46 GMT]]></title><description><![CDATA[<p>Hallo erstmal ich wollte euch mal von einem Fehler berichten, der bei mir aufgetreten ist.<br />
Zuerst: Ich nutze Microsoft Visual C++ 2008 Express Edition und das Tut von win - api .de / das erste WinAPI Programm.<br />
Ich erhalte folgenden Fehler :</p>
<pre><code>error C2664: 'MessageBoxW': Konvertierung des Parameters 2 von 'const char [137]' in 'LPCWSTR' nicht möglich
</code></pre>
<p>bei folgendem Code:</p>
<pre><code class="language-cpp">#define STRICT
#include &lt;iostream&gt;
#include &lt;windows.h&gt;

const char  szWitz[] = &quot;\&quot;Ich steh' schwer auf Umweltschutz\&quot;, sagt Peter.\n&quot;
                       &quot;\&quot;Ich werfe zum Beispiel alte U-Bahn-Fahrscheine nie weg,\n&quot;
                       &quot;sondern benutze sie mehrmals.\&quot;&quot;;

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PSTR szCmdLine, int iCmdShow)
{

 int iAntwort = MessageBox(NULL, szWitz, &quot;Ha, ha, ha, ha...&quot;,
                                   MB_ICONINFORMATION | MB_OKCANCEL | MB_DEFBUTTON1);

if (IDOK == iAntwort)
   {
      MessageBox(NULL, &quot;Ja, ich finde den Witz auch Ok...&quot;,
                       &quot;Sie haben auf Ok gedrückt&quot;,
                       MB_ICONINFORMATION | MB_OK | MB_DEFBUTTON1);
   }

else if (IDCANCEL == iAntwort)
   {
      MessageBox(NULL, &quot;Ja, warum haben sie denn auf Abbrechen gedrückt?\n&quot;
                       &quot;Hat ihnen der Witz etwa nicht gefallen?&quot;,
                       &quot;Sie haben auf Abbrechen gedrückt&quot;,
                       MB_ICONINFORMATION  | MB_OK | MB_DEFBUTTON1);
   }

    return 0;
}
</code></pre>
<p>Der Fehler tritt drei mal in den Zeilen : 15, 22, 31 auf.<br />
Ich hoffe ihr könnt mir sagen was ich falsch gemacht habe.<br />
Euer Hihi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1483236</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1483236</guid><dc:creator><![CDATA[Hihi]]></dc:creator><pubDate>Sun, 30 Mar 2008 15:54:46 GMT</pubDate></item><item><title><![CDATA[Reply to Tutorial von win-api.de on Sun, 30 Mar 2008 16:00:28 GMT]]></title><description><![CDATA[<p>die neuen VCs kompilieren standardmäßig mit UNICODE an. das musste in den optionen mal ausstellen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1483241</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1483241</guid><dc:creator><![CDATA[rofler]]></dc:creator><pubDate>Sun, 30 Mar 2008 16:00:28 GMT</pubDate></item><item><title><![CDATA[Reply to Tutorial von win-api.de on Sun, 30 Mar 2008 16:14:02 GMT]]></title><description><![CDATA[<p>Kannst bitte noch erläutern wo genau ich das einstellen muss?<br />
Hihi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1483254</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1483254</guid><dc:creator><![CDATA[Hihi]]></dc:creator><pubDate>Sun, 30 Mar 2008 16:14:02 GMT</pubDate></item><item><title><![CDATA[Reply to Tutorial von win-api.de on Sun, 30 Mar 2008 16:28:58 GMT]]></title><description><![CDATA[<p><a href="http://www.bilder-upload.eu/upload/e3ftx0ixqnpREhL.JPG" rel="nofollow">http://www.bilder-upload.eu/upload/e3ftx0ixqnpREhL.JPG</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1483259</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1483259</guid><dc:creator><![CDATA[ohneworte]]></dc:creator><pubDate>Sun, 30 Mar 2008 16:28:58 GMT</pubDate></item><item><title><![CDATA[Reply to Tutorial von win-api.de on Sun, 30 Mar 2008 16:32:47 GMT]]></title><description><![CDATA[<p>Boah Danke.<br />
Hihi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1483263</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1483263</guid><dc:creator><![CDATA[Hihi]]></dc:creator><pubDate>Sun, 30 Mar 2008 16:32:47 GMT</pubDate></item><item><title><![CDATA[Reply to Tutorial von win-api.de on Sun, 30 Mar 2008 18:29:21 GMT]]></title><description><![CDATA[<p>Der Vollständigkeit halber...</p>
<p>Wenn du mit Unicode arbeiten willst, musst du deinen Strings ein L voranstellen, also z.B. so:<br />
L&quot;Mein Unicode-String&quot;</p>
<p>Dann handelt es sich nicht um 8-Bit chars, sondern um 16-Bit w_chars.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1483334</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1483334</guid><dc:creator><![CDATA[Vervollständiger]]></dc:creator><pubDate>Sun, 30 Mar 2008 18:29:21 GMT</pubDate></item><item><title><![CDATA[Reply to Tutorial von win-api.de on Sun, 30 Mar 2008 19:35:26 GMT]]></title><description><![CDATA[<p>Wenn man mit VS arbeitet, sollte man immer TCHAR verwenden...<br />
Also für String-Literale:</p>
<pre><code class="language-cpp">_T(&quot;String Literal&quot;)
</code></pre>
<p>Dann geht es sowohl mit ANSI als auch UNICODE.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1483379</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1483379</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sun, 30 Mar 2008 19:35:26 GMT</pubDate></item></channel></rss>