<?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[MediaPlayer + Verknüpfung auf wav-Datei]]></title><description><![CDATA[<p>Hallo,</p>
<p>in meiner Anwendung lese ich wav- und mp3-Dateien aus einem Verzeichnis in eine ListBox ein. Der Benutzer kann dann einen Eintrag auswählen und per Doppelklick abspielen. Soweit so gut.</p>
<p>Wie kann ich es anstellen, dass der MediaPlayer auch Verknüpfung auf wav- oder mp3-Dateien, die sich in diesem Verzeichnis befinden, abspielt.</p>
<p>Gruß<br />
Leo</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/99103/mediaplayer-verknüpfung-auf-wav-datei</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 14:06:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/99103.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 25 Jan 2005 15:31:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MediaPlayer + Verknüpfung auf wav-Datei on Tue, 25 Jan 2005 15:31:35 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>in meiner Anwendung lese ich wav- und mp3-Dateien aus einem Verzeichnis in eine ListBox ein. Der Benutzer kann dann einen Eintrag auswählen und per Doppelklick abspielen. Soweit so gut.</p>
<p>Wie kann ich es anstellen, dass der MediaPlayer auch Verknüpfung auf wav- oder mp3-Dateien, die sich in diesem Verzeichnis befinden, abspielt.</p>
<p>Gruß<br />
Leo</p>
]]></description><link>https://www.c-plusplus.net/forum/post/705684</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/705684</guid><dc:creator><![CDATA[Leo Freitag]]></dc:creator><pubDate>Tue, 25 Jan 2005 15:31:35 GMT</pubDate></item><item><title><![CDATA[Reply to MediaPlayer + Verknüpfung auf wav-Datei on Tue, 25 Jan 2005 19:29:56 GMT]]></title><description><![CDATA[<p>So???</p>
<pre><code class="language-cpp">//Testet in FileName uebergebenen Dateinamen
//Falls es eine *.LNK- Datei ist:
//  Returnwert = &quot;Datei&quot; oder &quot;Verzeichnis&quot;
//  in FileName wird gelinkter Namen zurueckgegeben!
//sonst
//  Returnwert= &quot;Kein Link&quot; oder &quot;gelöscht&quot;

AnsiString __fastcall GetLinkedFile(AnsiString &amp;FileName)
{
  AnsiString SL_Typ;
  HRESULT hres;
  IShellLink *pShLink;
  char Path[MAX_PATH];
  char Descript[MAX_PATH];
  char WorkDir[MAX_PATH];
  char Arguments[MAX_PATH];
  WIN32_FIND_DATA wfd;
  hres=CoInitialize(NULL);
  if (SUCCEEDED(hres))
  { hres = CoCreateInstance( CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID *)&amp;pShLink );
    if (SUCCEEDED(hres))
    {  IPersistFile *ppf;
       hres = pShLink-&gt;QueryInterface( IID_IPersistFile, (LPVOID *)&amp;ppf );
       if (SUCCEEDED(hres))
       {  WORD wsz[MAX_PATH];
          MultiByteToWideChar( CP_ACP, 0, FileName.c_str(), -1, (wchar_t*)wsz, MAX_PATH );
          hres = ppf-&gt;Load((wchar_t*)wsz, STGM_READ );
          if (SUCCEEDED(hres))
          { hres = pShLink-&gt;GetPath(  &amp;Path[0], MAX_PATH, &amp;wfd, SLGP_UNCPRIORITY/*oder: SLGP_SHORTPATH für kurze Namen*/ );
            if(SUCCEEDED(hres))
            { hres = pShLink-&gt;GetDescription( &amp;Descript[0], MAX_PATH );
              if(SUCCEEDED(hres))
              { hres = pShLink-&gt;GetWorkingDirectory( &amp;WorkDir[0], MAX_PATH );
                if(SUCCEEDED(hres))
                { hres = pShLink-&gt;GetArguments( &amp;Arguments[0], MAX_PATH );
                }
              }
            }
          }
          else
            SL_Typ=&quot;Kein Link&quot;;
          ppf-&gt;Release();
       }
       pShLink-&gt;Release();
    }
    CoUninitialize();
  }
  if (hres==0)
  { TSearchRec SR;
    if (FindFirst(Path,faAnyFile,SR)==0)
    { if ((SR.Attr&amp;faDirectory)==faDirectory)
        SL_Typ=&quot;Verzeichnis&quot;;
      else
        SL_Typ=&quot;Datei&quot;;
      FileName=Path;
    }
    else
    { SL_Typ=&quot;Gelöscht&quot;;
    }
    FindClose(SR);
  }
  return SL_Typ;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/705939</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/705939</guid><dc:creator><![CDATA[DerAltenburger]]></dc:creator><pubDate>Tue, 25 Jan 2005 19:29:56 GMT</pubDate></item><item><title><![CDATA[Reply to MediaPlayer + Verknüpfung auf wav-Datei on Wed, 26 Jan 2005 14:36:01 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>zunächst mal Danke für die üppige Antwort.</p>
<p>Nur leider gelingt es mir bisher nicht, den passenden Include heraus zu finden, um</p>
<pre><code class="language-cpp">IShellLink
</code></pre>
<p>referenzieren zu können.</p>
<p>Hättest Du eine Idee?</p>
<p>Gruß<br />
Leo</p>
]]></description><link>https://www.c-plusplus.net/forum/post/706655</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/706655</guid><dc:creator><![CDATA[Leo Freitag]]></dc:creator><pubDate>Wed, 26 Jan 2005 14:36:01 GMT</pubDate></item><item><title><![CDATA[Reply to MediaPlayer + Verknüpfung auf wav-Datei on Wed, 26 Jan 2005 19:36:44 GMT]]></title><description><![CDATA[<p>#include &lt;shlobj.h&gt; <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/707057</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/707057</guid><dc:creator><![CDATA[DerAltenburger]]></dc:creator><pubDate>Wed, 26 Jan 2005 19:36:44 GMT</pubDate></item><item><title><![CDATA[Reply to MediaPlayer + Verknüpfung auf wav-Datei on Thu, 27 Jan 2005 12:34:42 GMT]]></title><description><![CDATA[<p>DerAltenburger schrieb:</p>
<blockquote>
<p>#include &lt;shlobj.h&gt; <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>
</blockquote>
<p>Hi,</p>
<p>Danke, den Include hatte ich zwischenzeitlich auch entdeckt.</p>
<p>Jetzt stehe ich vor einem neuen Problem, das ich nicht ergrüden kann:</p>
<pre><code class="language-cpp">hres=CoInitialize(NULL);
  if (SUCCEEDED(hres))
</code></pre>
<p><strong>CoInitialize</strong> funktioniert bei mir nie, da <strong>if (SUCCEEDED(hres))</strong> immer <strong>false</strong> zurückgibt.</p>
<p>Woran kann es liegen?</p>
<p>Gruß<br />
Leo</p>
]]></description><link>https://www.c-plusplus.net/forum/post/707657</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/707657</guid><dc:creator><![CDATA[Leo Freitag]]></dc:creator><pubDate>Thu, 27 Jan 2005 12:34:42 GMT</pubDate></item><item><title><![CDATA[Reply to MediaPlayer + Verknüpfung auf wav-Datei on Thu, 27 Jan 2005 19:08:34 GMT]]></title><description><![CDATA[<p>Shau mal hier:</p>
<p><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/htm/cmf_a2c_36qt.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/htm/cmf_a2c_36qt.asp</a></p>
<p>Welche Rueckgabe von CoInitialize hast Du? Eventuell fehlt in einem Deiner Module ein abschliessendes CoUninitialize ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/708137</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/708137</guid><dc:creator><![CDATA[DerAltenburger]]></dc:creator><pubDate>Thu, 27 Jan 2005 19:08:34 GMT</pubDate></item><item><title><![CDATA[Reply to MediaPlayer + Verknüpfung auf wav-Datei on Sat, 29 Jan 2005 10:30:51 GMT]]></title><description><![CDATA[<p>DerAltenburger schrieb:</p>
<blockquote>
<p>Shau mal hier:</p>
<p><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/htm/cmf_a2c_36qt.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/htm/cmf_a2c_36qt.asp</a></p>
<p>Welche Rueckgabe von CoInitialize hast Du? Eventuell fehlt in einem Deiner Module ein abschliessendes CoUninitialize ?</p>
</blockquote>
<p>Hallo,</p>
<p>Problem gelöst!</p>
<p>Ich war bei meinem CoInitialize-Aufruf einfältigerweise davon ausgegangen, dass nur der Rückgabewert TRUE den Weg für den weiteren Programmablauf freimacht.<br />
Jetzt erfahre ich aber bei (noch) näherer Betrachtung der Doku, dass der Rückgabewert FALSE bedeuten kann, dass die Initialisierung bereits erfolgt ist.<br />
Somit also kein Grund mehr vorliegt, denn nachfolgenden Programmteil nicht ausführen zu lassen.</p>
<p>Danke nochmal an alle!</p>
<p>Gruß<br />
Leo</p>
<p>Das kann irgendeine Bibliothek gemacht haben. Ist aber auch nicht weiter wichtig. Ändere den Code einfach so ab:</p>
<p>C/C++ Code:<br />
blRetVal = SUCCEEDED(CoInitialize(NULL));<br />
C/C++ Code:<br />
blRetVal = SUCCEEDED(CoInitialize(NULL));<br />
C/C++ Code:<br />
blRetVal = SUCCEEDED(CoInitialize(NULL));</p>
]]></description><link>https://www.c-plusplus.net/forum/post/709431</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/709431</guid><dc:creator><![CDATA[Leo Freitag]]></dc:creator><pubDate>Sat, 29 Jan 2005 10:30:51 GMT</pubDate></item></channel></rss>