<?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[Msgbox]]></title><description><![CDATA[<p>Hi Leute,<br />
Ich habe mir eine Funktion zum ausgeben einer Messagebox geschrieben. Übergeben werden zwei Strings, die dann Titel und Text angeben.<br />
Variablen &quot;a&quot; und &quot;b&quot; sind die übergabeparameter.<br />
Leider funktioniert das Ganze nicht:</p>
<pre><code>void msgbox(String a, String b)
{
      typedef int (WINAPI *MessageBoxTimeOutWFunc)(HWND hWndParent,PWCHAR strText,PWCHAR strCaption, UINT uType,WORD wLanguageId,DWORD dwMilliseconds);
      HMODULE hMod = LoadLibrary(&quot;user32.dll&quot;);
      MessageBoxTimeOutWFunc pMessageBoxTimeout = (MessageBoxTimeOutWFunc)GetProcAddress(hMod,&quot;MessageBoxTimeoutW&quot;);
      pMessageBoxTimeout(NULL,L&quot;&quot;+a,L&quot;&quot;+b,MB_OK | MB_SETFOREGROUND,0,3000);
      FreeLibrary(hMod);
}
</code></pre>
<p>Fehler:</p>
<p><a href="http://Jesusfreak777.je.funpic.de/error.JPG" rel="nofollow">http://Jesusfreak777.je.funpic.de/error.JPG</a></p>
<p>cya<br />
David</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/162407/msgbox</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 18:09:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/162407.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Oct 2006 09:33:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Msgbox on Wed, 18 Oct 2006 09:34:40 GMT]]></title><description><![CDATA[<p>Hi Leute,<br />
Ich habe mir eine Funktion zum ausgeben einer Messagebox geschrieben. Übergeben werden zwei Strings, die dann Titel und Text angeben.<br />
Variablen &quot;a&quot; und &quot;b&quot; sind die übergabeparameter.<br />
Leider funktioniert das Ganze nicht:</p>
<pre><code>void msgbox(String a, String b)
{
      typedef int (WINAPI *MessageBoxTimeOutWFunc)(HWND hWndParent,PWCHAR strText,PWCHAR strCaption, UINT uType,WORD wLanguageId,DWORD dwMilliseconds);
      HMODULE hMod = LoadLibrary(&quot;user32.dll&quot;);
      MessageBoxTimeOutWFunc pMessageBoxTimeout = (MessageBoxTimeOutWFunc)GetProcAddress(hMod,&quot;MessageBoxTimeoutW&quot;);
      pMessageBoxTimeout(NULL,L&quot;&quot;+a,L&quot;&quot;+b,MB_OK | MB_SETFOREGROUND,0,3000);
      FreeLibrary(hMod);
}
</code></pre>
<p>Fehler:</p>
<p><a href="http://Jesusfreak777.je.funpic.de/error.JPG" rel="nofollow">http://Jesusfreak777.je.funpic.de/error.JPG</a></p>
<p>cya<br />
David</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1156896</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1156896</guid><dc:creator><![CDATA[777]]></dc:creator><pubDate>Wed, 18 Oct 2006 09:34:40 GMT</pubDate></item><item><title><![CDATA[Reply to Msgbox on Wed, 18 Oct 2006 09:39:46 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Du kannst einen AnsiString nicht auf ein C-String-Literal addieren, auf ein Widechar-Literal schon gar nicht. Da es dir ja offenbar nur um die konvertierung von AnsiString in WideString geht, reicht ja das hier</p>
<pre><code class="language-cpp">void msgbox(const String&amp; a, const String&amp; b)
{
      typedef int (WINAPI *MessageBoxTimeOutWFunc)(HWND hWndParent,PWCHAR strText,PWCHAR strCaption, UINT uType,WORD wLanguageId,DWORD dwMilliseconds);
      HMODULE hMod = LoadLibrary(&quot;user32.dll&quot;);
      MessageBoxTimeOutWFunc pMessageBoxTimeout = (MessageBoxTimeOutWFunc)GetProcAddress(hMod,&quot;MessageBoxTimeoutW&quot;);
      WideString a1 = a;
      WideString b1 = b;
      pMessageBoxTimeout(NULL,a1.c_bstr(),b1.c_bstr(),MB_OK | MB_SETFOREGROUND,0,3000);
      FreeLibrary(hMod);
}
</code></pre>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1156899</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1156899</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 18 Oct 2006 09:39:46 GMT</pubDate></item><item><title><![CDATA[Reply to Msgbox on Wed, 18 Oct 2006 09:45:30 GMT]]></title><description><![CDATA[<p>SUPER!<br />
Das funktioniert- danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1156908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1156908</guid><dc:creator><![CDATA[777]]></dc:creator><pubDate>Wed, 18 Oct 2006 09:45:30 GMT</pubDate></item><item><title><![CDATA[Reply to Msgbox on Wed, 18 Oct 2006 09:45:55 GMT]]></title><description><![CDATA[<p>Außerdem ist der Verzeichnisname C++ denkbar ungünstig. Das wird zu Problemen im BCB führen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1156909</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1156909</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 18 Oct 2006 09:45:55 GMT</pubDate></item></channel></rss>