<?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[Datei-Attribute auslesen; Worddateien OK, MP3s Fehler]]></title><description><![CDATA[<p>hallo,</p>
<p>habe mir ein Programm geschrieben, das mir von Dateien in einem Ordner die &quot;Titel&quot;-Infos auslesen soll. Solange ich es mit Word-Dokumenten zu tun haben, funktioniert mein Code, wenn ich aber etwa die Titelinformationen einer MP3 oder anderen Datei(was auch immer) auslesen will, funktioniert es komischerweise nciht.</p>
<p>wieso klappt das bei word-dateien, bei allen andere nicht.?<br />
ich versteh auch nicht so ganz, was mein Problem ist.</p>
<p>hier mal der code, der die titel infos ausliest</p>
<pre><code class="language-cpp">std::wstring get_titel(std::wstring path)
{
		 HRESULT hr = S_OK;
	     IPropertyStorage *pPropStg = NULL;
		 IPropertySetStorage *pPropSetStg = NULL;
		 PROPSPEC propspec; 
		 PROPVARIANT propRead;

		 hr = StgOpenStorageEx( path.c_str(),
			 STGM_READ | STGM_SHARE_EXCLUSIVE, STGFMT_ANY, 0, NULL, NULL, IID_IPropertySetStorage,
                    reinterpret_cast&lt;void**&gt;(&amp;pPropSetStg) );

		 if (hr != S_OK)
			 return std::wstring(L&quot;StgOpenStorageEx - ERROR&quot;);

		 hr = pPropSetStg-&gt;Open(PropSetfmtid, STGM_DIRECT | STGM_SHARE_EXCLUSIVE | STGM_READ, &amp;pPropStg );

		 if (hr != S_OK)
			 return std::wstring(L&quot;Open - ERROR&quot;);

		 propspec.ulKind = PRSPEC_PROPID;
		 propspec.propid  = 0x00000002;

		 hr = pPropStg-&gt;ReadMultiple(1, &amp;propspec, &amp;propRead);

		 if (hr != S_OK)
			 return std::wstring(L&quot;Read - ERROR&quot;);

		 std::string temp = propRead.pszVal;
		 TCHAR rtTC[1024]={0};
		 MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, temp.c_str(), static_cast&lt;int&gt;(temp.length()), rtTC, static_cast&lt;int&gt;(temp.length()));

		 std::wstring rtn = rtTC;

		 pPropSetStg-&gt;Release();
		 pPropStg-&gt;Release();	 
		 return rtn;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/207659/datei-attribute-auslesen-worddateien-ok-mp3s-fehler</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 15:08:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/207659.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 10 Mar 2008 13:24:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Datei-Attribute auslesen; Worddateien OK, MP3s Fehler on Mon, 10 Mar 2008 13:24:16 GMT]]></title><description><![CDATA[<p>hallo,</p>
<p>habe mir ein Programm geschrieben, das mir von Dateien in einem Ordner die &quot;Titel&quot;-Infos auslesen soll. Solange ich es mit Word-Dokumenten zu tun haben, funktioniert mein Code, wenn ich aber etwa die Titelinformationen einer MP3 oder anderen Datei(was auch immer) auslesen will, funktioniert es komischerweise nciht.</p>
<p>wieso klappt das bei word-dateien, bei allen andere nicht.?<br />
ich versteh auch nicht so ganz, was mein Problem ist.</p>
<p>hier mal der code, der die titel infos ausliest</p>
<pre><code class="language-cpp">std::wstring get_titel(std::wstring path)
{
		 HRESULT hr = S_OK;
	     IPropertyStorage *pPropStg = NULL;
		 IPropertySetStorage *pPropSetStg = NULL;
		 PROPSPEC propspec; 
		 PROPVARIANT propRead;

		 hr = StgOpenStorageEx( path.c_str(),
			 STGM_READ | STGM_SHARE_EXCLUSIVE, STGFMT_ANY, 0, NULL, NULL, IID_IPropertySetStorage,
                    reinterpret_cast&lt;void**&gt;(&amp;pPropSetStg) );

		 if (hr != S_OK)
			 return std::wstring(L&quot;StgOpenStorageEx - ERROR&quot;);

		 hr = pPropSetStg-&gt;Open(PropSetfmtid, STGM_DIRECT | STGM_SHARE_EXCLUSIVE | STGM_READ, &amp;pPropStg );

		 if (hr != S_OK)
			 return std::wstring(L&quot;Open - ERROR&quot;);

		 propspec.ulKind = PRSPEC_PROPID;
		 propspec.propid  = 0x00000002;

		 hr = pPropStg-&gt;ReadMultiple(1, &amp;propspec, &amp;propRead);

		 if (hr != S_OK)
			 return std::wstring(L&quot;Read - ERROR&quot;);

		 std::string temp = propRead.pszVal;
		 TCHAR rtTC[1024]={0};
		 MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, temp.c_str(), static_cast&lt;int&gt;(temp.length()), rtTC, static_cast&lt;int&gt;(temp.length()));

		 std::wstring rtn = rtTC;

		 pPropSetStg-&gt;Release();
		 pPropStg-&gt;Release();	 
		 return rtn;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1471433</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1471433</guid><dc:creator><![CDATA[Jason2345]]></dc:creator><pubDate>Mon, 10 Mar 2008 13:24:16 GMT</pubDate></item><item><title><![CDATA[Reply to Datei-Attribute auslesen; Worddateien OK, MP3s Fehler on Mon, 10 Mar 2008 16:18:55 GMT]]></title><description><![CDATA[<p>Sorry, zu deinem Problem fällt mir gerade keine Löpsung ein. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Du kannst mir aber nicht zufällig sagen, welche propid für &quot;Kategorie&quot; verwendet wird?</p>
<p>Kann die einfach nicht finden... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Gruß<br />
ChrisH</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1471570</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1471570</guid><dc:creator><![CDATA[ChrisH]]></dc:creator><pubDate>Mon, 10 Mar 2008 16:18:55 GMT</pubDate></item><item><title><![CDATA[Reply to Datei-Attribute auslesen; Worddateien OK, MP3s Fehler on Mon, 10 Mar 2008 17:31:14 GMT]]></title><description><![CDATA[<p>Eine MP3 Datei ist keine COM-Structured storage!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1471615</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1471615</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 10 Mar 2008 17:31:14 GMT</pubDate></item><item><title><![CDATA[Reply to Datei-Attribute auslesen; Worddateien OK, MP3s Fehler on Tue, 11 Mar 2008 07:43:58 GMT]]></title><description><![CDATA[<p>ChrisH schrieb:</p>
<blockquote>
<p>Sorry, zu deinem Problem fällt mir gerade keine Löpsung ein. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Du kannst mir aber nicht zufällig sagen, welche propid für &quot;Kategorie&quot; verwendet wird?</p>
<p>Kann die einfach nicht finden... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Gruß<br />
ChrisH</p>
</blockquote>
<p>0x00000002 = PIDSI_TITLE = Title</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/35992">@Martin</a><br />
Wie komme ich den dann an die Informationen von anderen Dateien ran, wenn nicht über COM worüber dann?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1471850</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1471850</guid><dc:creator><![CDATA[Jason2345]]></dc:creator><pubDate>Tue, 11 Mar 2008 07:43:58 GMT</pubDate></item><item><title><![CDATA[Reply to Datei-Attribute auslesen; Worddateien OK, MP3s Fehler on Tue, 11 Mar 2008 08:06:42 GMT]]></title><description><![CDATA[<p>Bei MP3s würde ich mal vermuten, dass der Explorer die Header ausliest. Und das kannst du ja auch machen.</p>
<p>-&gt; <a href="http://de.wikipedia.org/wiki/ID3-Tag" rel="nofollow">http://de.wikipedia.org/wiki/ID3-Tag</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1471857</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1471857</guid><dc:creator><![CDATA[mad_martin]]></dc:creator><pubDate>Tue, 11 Mar 2008 08:06:42 GMT</pubDate></item><item><title><![CDATA[Reply to Datei-Attribute auslesen; Worddateien OK, MP3s Fehler on Tue, 11 Mar 2008 11:40:23 GMT]]></title><description><![CDATA[<p>mad_martin schrieb:</p>
<blockquote>
<p>Bei MP3s würde ich mal vermuten, dass der Explorer die Header ausliest. Und das kannst du ja auch machen.</p>
<p>-&gt; <a href="http://de.wikipedia.org/wiki/ID3-Tag" rel="nofollow">http://de.wikipedia.org/wiki/ID3-Tag</a></p>
</blockquote>
<p>hm, ja, hast recht. hab ich jetzt überhaupt nicht dran gedacht. ok danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1471983</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1471983</guid><dc:creator><![CDATA[Jason2345]]></dc:creator><pubDate>Tue, 11 Mar 2008 11:40:23 GMT</pubDate></item></channel></rss>