<?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[Dokumententitel auslesen]]></title><description><![CDATA[<p>hi,</p>
<p>ich will ein Programm schreiben, dass mir neben dem Dateinamen auch die gesetzten &quot;Titel&quot; eines Worddokumentes ausliest. an die dateinamen komme ich über FindFirstFile und FindNextFile. Aber wie komme ich an die restlichen Infos dran die im Explorer angezeigt werden, wenn man die ansicht auf &quot;Details&quot; stellt?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/206558/dokumententitel-auslesen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 22:16:38 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/206558.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 26 Feb 2008 12:58:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dokumententitel auslesen on Tue, 26 Feb 2008 12:58:16 GMT]]></title><description><![CDATA[<p>hi,</p>
<p>ich will ein Programm schreiben, dass mir neben dem Dateinamen auch die gesetzten &quot;Titel&quot; eines Worddokumentes ausliest. an die dateinamen komme ich über FindFirstFile und FindNextFile. Aber wie komme ich an die restlichen Infos dran die im Explorer angezeigt werden, wenn man die ansicht auf &quot;Details&quot; stellt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1463182</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1463182</guid><dc:creator><![CDATA[korig]]></dc:creator><pubDate>Tue, 26 Feb 2008 12:58:16 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Tue, 26 Feb 2008 14:09:05 GMT]]></title><description><![CDATA[<p>IShellFolder2::GetDetailsEx bzw. IShellFolder2::GetDetailsOf</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1463258</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1463258</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 26 Feb 2008 14:09:05 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Wed, 27 Feb 2008 12:05:56 GMT]]></title><description><![CDATA[<p>danke, hab mal bei MSDN nachgesehen, ich verstehen nicht ganz, woher ich die informationen für die Parameter bekomme, die ich übergeben muss:</p>
<p>HRESULT GetDetailsEx(<br />
PCUITEMID_CHILD pidl,<br />
const SHCOLUMNID *pscid,<br />
VARIANT *pv<br />
);</p>
<p>woher krieg ich den &quot;pidl&quot; ?</p>
<p>Was ist den pv für ein Typ, aus dem Satz &quot;A pointer to a VARIANT with the requested information. The value will be fully typed.&quot; werd ich nicht ganz schlau. is das ein typloser wert den ich casten mus??</p>
<p>wäre super wenn du mir noch mal helfen würdest, oder mir nen link zu nem beispiel geben könntest.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1463916</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1463916</guid><dc:creator><![CDATA[korig]]></dc:creator><pubDate>Wed, 27 Feb 2008 12:05:56 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Wed, 27 Feb 2008 12:49:13 GMT]]></title><description><![CDATA[<p>Was ein pidl ist steht in der MSDN bzgl. Shell... ich muss Dir das nicht vorkauen.</p>
<p>Ansonsten kannst Du Dir hier Anregungen holen:<br />
<a href="http://www.codeproject.com/KB/shell/recyclebin.aspx" rel="nofollow">http://www.codeproject.com/KB/shell/recyclebin.aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1463968</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1463968</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 27 Feb 2008 12:49:13 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Sun, 02 Mar 2008 11:52:04 GMT]]></title><description><![CDATA[<p>hm, also ich komme leider nicht wirklich damit klar.</p>
<p>habe mit diesem shell-sachen noch nie gearbeitet, mir fehlt da irgendwie etwas an wissen</p>
<pre><code class="language-cpp">SHELLDETAILS sd;
	IShellFolder2   shellfld;
	LPCITEMIDLIST   item;
	shellfld.GetDetailsOf(item, 0, &amp;sd);
</code></pre>
<p>Irgenwie muss ich ja den Ordner setzen in dem ich arbeiten möchte. Wie mach ich das?</p>
<p>Das mit dem pidl hab ich immernoch nicht rausbekommen. Zudem sagt er das IShellFolder2 abstrakt sei.</p>
<p>ich finde leider keine richtigen beipsiele zu dem theam und wenn sind diese nur in VBA geschreiben, womit ich leider gar nichts anfangen kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1466537</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1466537</guid><dc:creator><![CDATA[korig]]></dc:creator><pubDate>Sun, 02 Mar 2008 11:52:04 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Sun, 02 Mar 2008 18:11:41 GMT]]></title><description><![CDATA[<p>@korig: Hier läuft alles mit COM! Wnen Du noch nie mit diesen Dingen gearbeitet hast musst Du viel Grundsätzliches lernen.</p>
<p>Schau Die das Sample an, dass ich angegeben habe und versuche dananch und mit der Doku der MSDN die Sachen zu begreifen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1466801</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1466801</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sun, 02 Mar 2008 18:11:41 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Mon, 03 Mar 2008 10:55:51 GMT]]></title><description><![CDATA[<p>ja, merk ich auch grade.</p>
<p>gibts da was büchermäßiges für,w as du empfehlen kannst, das einen zumindest einen groben einstieg in das thema gibt ?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1467182</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467182</guid><dc:creator><![CDATA[korig]]></dc:creator><pubDate>Mon, 03 Mar 2008 10:55:51 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Mon, 03 Mar 2008 10:59:23 GMT]]></title><description><![CDATA[<p>Die ersten Kapitel von &quot;Indside OLE2&quot; für die Basics<br />
&quot;ATL Internals&quot; für den Umgang mit ATL und Safe-Pointern...<br />
&quot;Essential COM&quot; fürs eingemachte.</p>
<p>Tutorials sind etwas mit dem ich mich (seit Jahren) nicht (mehr) beschäftige. Vielleicht haben andere das Tipps!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1467184</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467184</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 03 Mar 2008 10:59:23 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Mon, 03 Mar 2008 17:54:12 GMT]]></title><description><![CDATA[<p>ok, danke.</p>
<p>wegen dem problem was ich ursprünglich hatte/hab. habe jetzt funktionierende code-schnipsel gefunden die DetailsOf verwenden, nur leider krieg ich die spalte mit dem titel inhalt nicht abgefragt, da diese scheinbar nicht existiert?!</p>
<p>hab mir das im Debug mal angeschaut, bis zur spaltennummer 7 liefert mir der Return Value S_OK und danach halt S_FALSE.</p>
<p>Leider steht in keiner Spalte der Titel drin, hab bei MSDN gelesen das wohl nur die ersten 4 IDs fest definiert sind und der rest mehr oder weniger willkürlich gesetzt ist. Komme ich mit DetailsOf also doch nicht an den titel ode rmuss ich da noch etwas anderes beachten?.</p>
<pre><code class="language-cpp">hr = isfCur-&gt;GetDetailsOf(pidl, 0, &amp;sd);
		 hr = isfCur-&gt;GetDetailsOf(pidl, 1, &amp;sd);
		 hr = isfCur-&gt;GetDetailsOf(pidl, 2, &amp;sd);
		 hr = isfCur-&gt;GetDetailsOf(pidl, 3, &amp;sd);
		 hr = isfCur-&gt;GetDetailsOf(pidl, 4, &amp;sd);
		 hr = isfCur-&gt;GetDetailsOf(pidl, 5, &amp;sd);
		 hr = isfCur-&gt;GetDetailsOf(pidl, 6, &amp;sd);
		 hr = isfCur-&gt;GetDetailsOf(pidl, 7, &amp;sd);
		 hr = isfCur-&gt;GetDetailsOf(pidl, 8, &amp;sd);
		 hr = isfCur-&gt;GetDetailsOf(pidl, 9, &amp;sd);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1467482</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1467482</guid><dc:creator><![CDATA[korig]]></dc:creator><pubDate>Mon, 03 Mar 2008 17:54:12 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Tue, 04 Mar 2008 20:54:31 GMT]]></title><description><![CDATA[<p>wenn man lang genug blutet gehts auch anders <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>
<pre><code class="language-cpp">IPropertyStorage *pPropStg = NULL;
		 IPropertySetStorage *pPropSetStg = NULL;
		 PROPSPEC propspec; 
		 PROPVARIANT propRead;

		 hr = StgOpenStorageEx( L&quot;C:\\temp\\test\\test.doc&quot;,
                    STGM_SHARE_EXCLUSIVE| STGM_READ, STGFMT_ANY, 0, NULL, NULL, IID_IPropertySetStorage,
                    reinterpret_cast&lt;void**&gt;(&amp;pPropSetStg) );

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

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

		 hr = pPropStg-&gt;ReadMultiple(1, &amp;propspec, &amp;propRead);
</code></pre>
<p>gemäß: <a href="http://www.codeproject.com/KB/files/SummInfoPropSetFile.aspx" rel="nofollow">http://www.codeproject.com/KB/files/SummInfoPropSetFile.aspx</a></p>
<p>in der propRead struktur steht dann der titel drin.</p>
<p>P.s: mit GetDetailsOf / GetDetailsEx hab ich es nicht hinbekommen</p>
<p>gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1468391</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1468391</guid><dc:creator><![CDATA[korig]]></dc:creator><pubDate>Tue, 04 Mar 2008 20:54:31 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Sun, 13 Apr 2008 15:39:40 GMT]]></title><description><![CDATA[<p>hallo,</p>
<p>ich muss das alte Thema noch mal ausbuddeln:</p>
<p>Kurz worum es geht:<br />
Ich habe eine Möglichkeit gesucht mit der ich die &quot;Titel&quot;-Information eines Worddokumentes auslesen kann, das ist die Information die man sieht, wenn man im Explorer die Spalte &quot;Titel&quot; Information aktiviert. Solch ein Text ist in der Regel nur bei Office-Dokumenten,sprich Word, Excel usw vorhanden. Das habe ich auch geschafft.</p>
<p>Nun mein Folgeproblem:<br />
Als Konsequenz aus dem lesen hab ich jetzt eine Funktion gebaut um den Titeltext einer Datei neu zu setzen. Das funktioniert auch soweit, im Explorer sehe ich den von mir gesetzten Titeltext in der vorgesehenen Spalte.</p>
<p>Öffne ich aber jetzt das (Word-)dokument mit Word und wähle über Datei-&gt;Eigenschaften die Funktion aus um über Word den Titel des Dokumentes (neu) zu setzen bzw. zu editieren, steht dort komischerweise nur der erste Buchstabe, des von mir gesetzten Textes.</p>
<p>Hat jemand eine Idee woran das liegen könnte?(Im Explorer steht er komplett und richtig drin)</p>
<p>Hier mal der Code mit dem ich den Titeltext setze:</p>
<pre><code class="language-cpp">bool FileManager::setNewTitelOfFile(std::wstring path, std::wstring titel)
{
		 FMTID PropSetfmtid={0xf29f85e0,0x4ff9,0x1068,{0xab, 0x91, 0x08, 0x00, 0x2b, 0x27, 0xb3, 0xd9 }};

	   	 HRESULT hr = S_OK;
	     IPropertyStorage *pPropStg = NULL;
		 IPropertySetStorage *pPropSetStg = NULL;
		 PROPSPEC propspec; 
		 PROPVARIANT propWrite;

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

		 if (hr == S_OK)
		 {
			 hr = pPropSetStg-&gt;Create(PropSetfmtid,
									  NULL,
									  PROPSETFLAG_DEFAULT,
									  STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE,
									  &amp;pPropStg);

			 if (hr == S_OK)
			 {
 				 propspec.ulKind = PRSPEC_PROPID;
				 propspec.propid  = 0x00000002;

				 //String umsetzen in TCHAR
				 TCHAR titelAsTCHAR[1024]={0};
				 StringCbPrintf(titelAsTCHAR, 1024, L&quot;%s&quot;, titel.c_str());
				 //von TCHAR nach char
				 char titelAsChar[1024] = {0};

				 WideCharToMultiByte(CP_ACP,
									 NULL,
									 titelAsTCHAR,
									 static_cast&lt;int&gt;(titel.length()),
									 titelAsChar,
									 static_cast&lt;int&gt;(titel.length()),
									 NULL,
									 NULL);

				 propWrite.pszVal = titelAsChar;
				 propWrite.vt     = VT_LPSTR;

				 hr = pPropStg-&gt;WriteMultiple(1, &amp;propspec, &amp;propWrite, PID_FIRST_USABLE);

				 if (hr == S_OK)
				 {
 					 pPropSetStg-&gt;Release();
					 pPropStg-&gt;Release();	
					 return true;
				 }
			 }
			 else
			 {
  				pPropSetStg-&gt;Release();
				pPropStg-&gt;Release();
			 }
		 }

		 return false;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1491364</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1491364</guid><dc:creator><![CDATA[korig]]></dc:creator><pubDate>Sun, 13 Apr 2008 15:39:40 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Sun, 13 Apr 2008 17:48:45 GMT]]></title><description><![CDATA[<p>korig schrieb:</p>
<blockquote>
<p>hallo,</p>
<p>ich muss das alte Thema noch mal ausbuddeln:</p>
<p>Kurz worum es geht:<br />
Ich habe eine Möglichkeit gesucht mit der ich die &quot;Titel&quot;-Information eines Worddokumentes auslesen kann, das ist die Information die man sieht, wenn man im Explorer die Spalte &quot;Titel&quot; Information aktiviert. Solch ein Text ist in der Regel nur bei Office-Dokumenten,sprich Word, Excel usw vorhanden. Das habe ich auch geschafft.</p>
<p>Nun mein Folgeproblem:<br />
Als Konsequenz aus dem lesen hab ich jetzt eine Funktion gebaut um den Titeltext einer Datei neu zu setzen. Das funktioniert auch soweit, im Explorer sehe ich den von mir gesetzten Titeltext in der vorgesehenen Spalte.</p>
<p>Öffne ich aber jetzt das (Word-)dokument mit Word und wähle über Datei-&gt;Eigenschaften die Funktion aus um über Word den Titel des Dokumentes (neu) zu setzen bzw. zu editieren, steht dort komischerweise nur der erste Buchstabe, des von mir gesetzten Textes.</p>
<p>Hat jemand eine Idee woran das liegen könnte?(Im Explorer steht er komplett und richtig drin)</p>
<p>Hier mal der Code mit dem ich den Titeltext setze:</p>
<pre><code class="language-cpp">bool FileManager::setNewTitelOfFile(std::wstring path, std::wstring titel)
{
		 FMTID PropSetfmtid={0xf29f85e0,0x4ff9,0x1068,{0xab, 0x91, 0x08, 0x00, 0x2b, 0x27, 0xb3, 0xd9 }};
	
	   	 HRESULT hr = S_OK;
	     IPropertyStorage *pPropStg = NULL;
		 IPropertySetStorage *pPropSetStg = NULL;
		 PROPSPEC propspec; 
		 PROPVARIANT propWrite;

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

		 if (hr == S_OK)
		 {
			 hr = pPropSetStg-&gt;Create(PropSetfmtid,
									  NULL,
									  PROPSETFLAG_DEFAULT,
									  STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE,
									  &amp;pPropStg);

			 if (hr == S_OK)
			 {
 				 propspec.ulKind = PRSPEC_PROPID;
				 propspec.propid  = 0x00000002;

				 //String umsetzen in TCHAR
				 TCHAR titelAsTCHAR[1024]={0};
				 StringCbPrintf(titelAsTCHAR, 1024, L&quot;%s&quot;, titel.c_str());
				 //von TCHAR nach char
				 char titelAsChar[1024] = {0};

				 WideCharToMultiByte(CP_ACP,
									 NULL,
									 titelAsTCHAR,
									 static_cast&lt;int&gt;(titel.length()),
									 titelAsChar,
									 static_cast&lt;int&gt;(titel.length()),
									 NULL,
									 NULL);

				 propWrite.pszVal = titelAsChar;
				 propWrite.vt     = VT_LPSTR;
				 		
				 hr = pPropStg-&gt;WriteMultiple(1, &amp;propspec, &amp;propWrite, PID_FIRST_USABLE);

				 if (hr == S_OK)
				 {
 					 pPropSetStg-&gt;Release();
					 pPropStg-&gt;Release();	
					 return true;
				 }
			 }
			 else
			 {
  				pPropSetStg-&gt;Release();
				pPropStg-&gt;Release();
			 }
		 }

		 return false;
</code></pre>
</blockquote>
<p>ich wäre wirklich für jede art von tipp dankbar. es reicht auch schon wenn jemand ein forum kennt, wo leute unterwegs sind die sich mit programmierung rund um ms-office produkte auskennt.</p>
<p>hab jetzt meine mittel ausgeschöpft, mit Black-box testing komm ich nicht mehr weiter, ich brauch jemand der ahnung von der materie hat und weis wie office-arbeitet</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1491436</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1491436</guid><dc:creator><![CDATA[korig]]></dc:creator><pubDate>Sun, 13 Apr 2008 17:48:45 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Sun, 13 Apr 2008 21:52:04 GMT]]></title><description><![CDATA[<p>eventuell die Newsgroup microsoft.public.win32.programmer.ole</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1491539</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1491539</guid><dc:creator><![CDATA[...........]]></dc:creator><pubDate>Sun, 13 Apr 2008 21:52:04 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Mon, 14 Apr 2008 00:14:34 GMT]]></title><description><![CDATA[<p>Funktioniert dieser Code bei dir?</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;iostream&gt;

const FMTID FMTID_SummaryInformation = {0xf29f85e0, 0x4ff9, 0x1068, {0xab, 0x91, 0x08, 0x00, 0x2b, 0x27, 0xb3, 0xd9}};

bool setTitle(wchar_t* filename, char* title)
{
    HRESULT hr;

    IStorage* pStorage;
    hr = StgOpenStorage(filename, NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, NULL, 0, &amp;pStorage);

    if(FAILED(hr))
    {
        std::cout &lt;&lt; &quot;StgOpenStorage failed!&quot; &lt;&lt; '\n';
        return false;
    }

    IPropertySetStorage* pPropertySetStorage;
    hr = pStorage-&gt;QueryInterface(IID_IPropertySetStorage, reinterpret_cast&lt;void**&gt;(&amp;pPropertySetStorage));

    if(FAILED(hr))
    {
        std::cout &lt;&lt; &quot;IStorage::QueryInterface for IPropertySetStorage failed!&quot; &lt;&lt; '\n';
        pStorage-&gt;Release();
        return false;
    }

    IPropertyStorage* pPropertyStorage;
    hr = pPropertySetStorage-&gt;Open(FMTID_SummaryInformation, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, &amp;pPropertyStorage);

    if(FAILED(hr))
    {
        std::cout &lt;&lt; &quot;IPropertyStorage::Open failed!&quot; &lt;&lt; '\n';
        pPropertySetStorage-&gt;Release();
        pStorage-&gt;Release();
        return false;
    }

    PROPSPEC propertySpecification;
    propertySpecification.ulKind = PRSPEC_PROPID;
    propertySpecification.propid = PIDSI_TITLE;

    PROPVARIANT property;
    property.vt = VT_LPSTR;
    property.pszVal = title;

    hr = pPropertyStorage-&gt;WriteMultiple(1, &amp;propertySpecification, &amp;property, 2);

    if(FAILED(hr))
    {
        std::cout &lt;&lt; &quot;IPropertyStorage::WriteMultiple failed!&quot; &lt;&lt; '\n';
        return false;
    }

    pPropertyStorage-&gt;Release();
    pPropertySetStorage-&gt;Release();
    pStorage-&gt;Release();

    return true;
}

int main()
{
    setTitle(L&quot;C:\\test.doc&quot;, &quot;Test&quot;);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1491573</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1491573</guid><dc:creator><![CDATA[..........]]></dc:creator><pubDate>Mon, 14 Apr 2008 00:14:34 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Mon, 14 Apr 2008 05:19:57 GMT]]></title><description><![CDATA[<p>Konnte den Fehler auch nachvollziehen als ich jetzt mal Create statt Open von IPropertySetStorage ausprobiert habe.</p>
<p>Lösungen damit der Fehler nicht auftritt:</p>
<p>PROPSETFLAG_ANSI statt PROPSETFLAG_DEFAULT benutzen.</p>
<p>oder</p>
<p>Die Property als Widestring also VT_LPWSTR schreiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1491583</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1491583</guid><dc:creator><![CDATA[..........]]></dc:creator><pubDate>Mon, 14 Apr 2008 05:19:57 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Mon, 14 Apr 2008 05:31:02 GMT]]></title><description><![CDATA[<p>.......... schrieb:</p>
<blockquote>
<p>Funktioniert dieser Code bei dir?</p>
</blockquote>
<p>nein, bei</p>
<pre><code class="language-cpp">hr = pPropertySetStorage-&gt;Open(FMTID_SummaryInformation, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, &amp;pPropertyStorage);
</code></pre>
<p>bricht er ab und bekommt in hr den wert &quot;wurde nicht gefunden&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1491587</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1491587</guid><dc:creator><![CDATA[korig]]></dc:creator><pubDate>Mon, 14 Apr 2008 05:31:02 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Mon, 14 Apr 2008 11:14:18 GMT]]></title><description><![CDATA[<p>Hast du das Dokument im Explorer über Neu -&gt; Microsoft Word Dokument angelegt? In dem Fall geht es auch bei mir nicht. Dann muss man erst ein Property Set mit pPropertySetStorage-&gt;Create anlegen.</p>
<p>Und hast du meinen dritten Beitrag übersehen oder warum hast du dich dazu nicht geäußert? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1491741</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1491741</guid><dc:creator><![CDATA[..........]]></dc:creator><pubDate>Mon, 14 Apr 2008 11:14:18 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Mon, 14 Apr 2008 20:27:34 GMT]]></title><description><![CDATA[<p>ja super, besten dank.</p>
<p>hatte deinen beitrag überlesen, weil ich was länger gebraucht hab um meine antwort zu tippen.</p>
<p>danke, denke so ist das ok. ist es ein problem, bei jedem mal wenn ich den text setzen will ein Create zu machen? oder gibt das irgendwie probleme?(bisher keine festgestellt, frag nur so)</p>
<p>und noch was, ich hab auch eine routine zum lesen der titel information, die im wesentlich gleich aufgebaut ist. Bei PDF-Dokumenten versagt die Funktion, liegt das an meinem code oder kann man über das Ipropertystorage interface nicht an den titel ovn PDFs kommen?</p>
<p>Mein code zum lesen</p>
<pre><code class="language-cpp">std::wstring FileManager::readTitelOfFile(std::wstring path)
{
		 //Typ des Titel - Propertysets
		 FMTID PropSetfmtid={0xf29f85e0,0x4ff9,0x1068,{0xab, 0x91, 0x08, 0x00, 0x2b, 0x27, 0xb3, 0xd9 }};

	   	 HRESULT hr = S_OK;
	     IPropertyStorage *pPropStg = NULL;
		 IPropertySetStorage *pPropSetStg = NULL;
		 PROPSPEC propspec; 
		 PROPVARIANT propRead;

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

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

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

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

		 //Setzen welche Information gelesen werden soll
		 propspec.ulKind = PRSPEC_PROPID;
		 propspec.propid  = 0x00000002; //Titel

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

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

		 //char-ANSI nach TCHAR-Unicode umsetzen
		 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()));

		 //aus TCHAR-Array neuen String erzeugen
		 std::wstring rtn = rtTC;

		 pPropSetStg-&gt;Release();
		 pPropStg-&gt;Release();	
		 return rtn;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1492106</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1492106</guid><dc:creator><![CDATA[korig]]></dc:creator><pubDate>Mon, 14 Apr 2008 20:27:34 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Mon, 14 Apr 2008 22:15:45 GMT]]></title><description><![CDATA[<p>Eine PDF Datei ist keine COM-Structured storage!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1492153</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1492153</guid><dc:creator><![CDATA[mr]]></dc:creator><pubDate>Mon, 14 Apr 2008 22:15:45 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Tue, 15 Apr 2008 04:12:05 GMT]]></title><description><![CDATA[<p>mr schrieb:</p>
<blockquote>
<p>Eine PDF Datei ist keine COM-Structured storage!</p>
</blockquote>
<p>hm, wie komm da dann an die Information die ich brauche. hatte es mal mit GetDetailsOf probiert, aber keine der information die ich damit bekommen hab, war die, die ich gesucht hab.....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1492166</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1492166</guid><dc:creator><![CDATA[korig]]></dc:creator><pubDate>Tue, 15 Apr 2008 04:12:05 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Tue, 15 Apr 2008 08:45:58 GMT]]></title><description><![CDATA[<p>Ich hab mal nach GetDetailsOf bei Codeproject gesucht und darauf gestossen:</p>
<p><a href="http://www.codeproject.com/KB/files/detailedfileinfo.aspx" rel="nofollow">http://www.codeproject.com/KB/files/detailedfileinfo.aspx</a></p>
<p>Bei mir kanns die PDF Informationen auslesen, wenn Adobe Acrobat Reader installiert ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1492265</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1492265</guid><dc:creator><![CDATA[mr]]></dc:creator><pubDate>Tue, 15 Apr 2008 08:45:58 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Tue, 15 Apr 2008 19:43:40 GMT]]></title><description><![CDATA[<p>hatte dazu schonmal eine &quot;eigene&quot; routine gebastelt, (ok, sind zusammenkopierte code-schnipsel).</p>
<p>damit kann ich informationen lesen wie dateiname, änderungsdatum, erstellungsdatum usw. aber halt nicht die titelinformation</p>
<p>würde mich interessieren was ich falsch gemacht hab, aber aufjedenfall schonmal danke für den link. (würd am liebsten aber keine fremden klassen benutzen, dann weis ich wenigsten das ich schuld bin, wenns nicht funktioniert <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";-)"
      alt="😉"
    /> ).</p>
<p>kannst du mir evtl sagen was ich da falsch machen, ich komm an alles ran, nur nicht an den doofen titel.</p>
<pre><code class="language-cpp">// GetDetailsOf.cpp : Defines the entry point for the console application.
//

#include &quot;stdafx.h&quot;

// ListDirCon.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
//

#include &quot;stdafx.h&quot;
#include &quot;windows.h&quot;
#include &quot;shlobj.h&quot;
#include &lt;iostream&gt;

using namespace std;

int _tmain(int argc, TCHAR* argv[])
{

char path[MAX_PATH] = &quot;C:\\temp\\&quot;;

    HRESULT hr;
    IShellFolder * isfDesktop = NULL;
    IShellFolder2 * isfCur = NULL;

   hr = CoInitialize(NULL); // initialize COM

   LPMALLOC pMalloc = NULL; // memory manager, for freeing up PIDLs
   hr = SHGetMalloc(&amp;pMalloc);

   hr = SHGetDesktopFolder(&amp;isfDesktop);
   isfDesktop-&gt;QueryInterface(IID_IShellFolder2, (LPVOID*)&amp;isfCur);

   // IShellFolder::ParseDisplayName requires the path name in Unicode.
   OLECHAR olePath[MAX_PATH]; // wide-char version of path name
   MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, path, -1, olePath, MAX_PATH);

   // parse path for absolute PIDL, and connect to target folder
   LPITEMIDLIST pidl = NULL; // general purpose
   hr = isfDesktop-&gt;ParseDisplayName(NULL, NULL, olePath, NULL, &amp;pidl, NULL);
   LPSHELLFOLDER psfFolder = NULL;
   hr = isfDesktop-&gt;BindToObject(pidl, NULL, IID_IShellFolder,
                                 (void**)&amp;psfFolder);
   isfDesktop-&gt;Release(); // no longer required
   pMalloc-&gt;Free(pidl);

   LPENUMIDLIST penumIDL = NULL; // IEnumIDList interface for reading contents
   hr = psfFolder-&gt;EnumObjects(NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS,
                               &amp;penumIDL);
   while(1) {
      // retrieve a copy of next local item ID list
      hr = penumIDL-&gt;Next(1, &amp;pidl, NULL);

      if(hr == NOERROR) {
         WIN32_FIND_DATA ffd;
         hr = SHGetDataFromIDList(psfFolder, pidl, SHGDFIL_FINDDATA, &amp;ffd,
                                  sizeof(WIN32_FIND_DATA));

         SHELLDETAILS sd;

         hr = isfCur-&gt;GetDetailsOf(pidl, 0, &amp;sd);
         wcout&lt;&lt;sd.str.pOleStr&lt;&lt;endl;
         hr = isfCur-&gt;GetDetailsOf(pidl, 1, &amp;sd);
         wcout&lt;&lt;sd.str.pOleStr&lt;&lt;endl;
         hr = isfCur-&gt;GetDetailsOf(pidl, 2, &amp;sd);
         wcout&lt;&lt;sd.str.pOleStr&lt;&lt;endl;
         hr = isfCur-&gt;GetDetailsOf(pidl, 3, &amp;sd);
         wcout&lt;&lt;sd.str.pOleStr&lt;&lt;endl;
         hr = isfCur-&gt;GetDetailsOf(pidl, 4, &amp;sd);
         wcout&lt;&lt;sd.str.pOleStr&lt;&lt;endl;
         hr = isfCur-&gt;GetDetailsOf(pidl, 5, &amp;sd);
         wcout&lt;&lt;sd.str.pOleStr&lt;&lt;endl;
         hr = isfCur-&gt;GetDetailsOf(pidl, 6, &amp;sd);
         wcout&lt;&lt;sd.str.pOleStr&lt;&lt;endl;
         hr = isfCur-&gt;GetDetailsOf(pidl, 7, &amp;sd);
         wcout&lt;&lt;sd.str.pOleStr&lt;&lt;endl;
         hr = isfCur-&gt;GetDetailsOf(pidl, -1, &amp;sd);
         wcout&lt;&lt;sd.str.pOleStr&lt;&lt;endl;

         wcout &lt;&lt; L&quot;Name = &quot; &lt;&lt; ffd.cFileName &lt;&lt; endl;
         wcout &lt;&lt; L&quot;Type = &quot; &lt;&lt; ( (ffd.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
                                ? &quot;dir\n&quot; : &quot;file\n&quot; );
         wcout &lt;&lt; L&quot;Size = &quot; &lt;&lt; ffd.nFileSizeLow &lt;&lt; endl;

         pMalloc-&gt;Free(pidl);
      }
      else break;
   }

   // release all remaining interface pointers
   penumIDL-&gt;Release();
   psfFolder-&gt;Release();
   pMalloc-&gt;Release();

   CoUninitialize(); // shut down COM

    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1492614</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1492614</guid><dc:creator><![CDATA[korig]]></dc:creator><pubDate>Tue, 15 Apr 2008 19:43:40 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Tue, 15 Apr 2008 20:54:01 GMT]]></title><description><![CDATA[<p>Ich werd demnächst mal gucken ob ich den Fehler finde, aber ich kann da nichts versprechen, ich kenn mich damit nämlich auch nicht aus. Aber ich hatte gar nicht gesehen das Martin Richter dir schon einen Link gegeben hat. Da kannst du doch einfach ein paar Debug-Ausgaben reinbauen um z.B. zu sehen welche ID der Titel hat.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1492651</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1492651</guid><dc:creator><![CDATA[mr]]></dc:creator><pubDate>Tue, 15 Apr 2008 20:54:01 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Tue, 15 Apr 2008 21:17:10 GMT]]></title><description><![CDATA[<p>Ich wüsste auch nicht wie man das mit GetDetailsOf zuverlässig hinbekommen soll wenn die ID immer unterschiedlich sein kann.<br />
Deshalb habe ich nach einem Beispiel für GetDetailsEx gegoogled und bin auf das gestossen: <a href="http://www.experts-exchange.com/Programming/Languages/CPP/Q_21038514.html" rel="nofollow">http://www.experts-exchange.com/Programming/Languages/CPP/Q_21038514.html</a></p>
<p>Kanns im Moment nicht ausprobieren, aber es sieht gut aus. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1492664</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1492664</guid><dc:creator><![CDATA[mr]]></dc:creator><pubDate>Tue, 15 Apr 2008 21:17:10 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Wed, 16 Apr 2008 07:00:47 GMT]]></title><description><![CDATA[<p>Schade, klappt doch nicht, wenn man GetDetailsEx mit FMTID_SummaryInformation benutzt funktioniert es nur bei Dateien mit Structured Storage.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1492732</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1492732</guid><dc:creator><![CDATA[mr]]></dc:creator><pubDate>Wed, 16 Apr 2008 07:00:47 GMT</pubDate></item><item><title><![CDATA[Reply to Dokumententitel auslesen on Wed, 16 Apr 2008 08:38:31 GMT]]></title><description><![CDATA[<p>Ah es geht doch, hatte nur ein CoInitializeEx oder OleInitialize vergessen. <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="🙂"
    /> <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>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;shlobj.h&gt;
#include &lt;iostream&gt;
#include &lt;string&gt;

std::wstring getTitle(const std::wstring&amp; path, const std::wstring&amp; filename)
{
	IMalloc* pMalloc;
	SHGetMalloc(&amp;pMalloc);

	IShellFolder* pDesktopFolder;
	SHGetDesktopFolder(&amp;pDesktopFolder);

	ITEMIDLIST* pidlShellItem;
	pDesktopFolder-&gt;ParseDisplayName(NULL, NULL, const_cast&lt;wchar_t*&gt;(path.c_str()), NULL, &amp;pidlShellItem, NULL);

	IShellFolder2* pFolder;
	pDesktopFolder-&gt;BindToObject(pidlShellItem, NULL, IID_IShellFolder2, reinterpret_cast&lt;void**&gt;(&amp;pFolder));
	pMalloc-&gt;Free(pidlShellItem);

	pFolder-&gt;ParseDisplayName(NULL, NULL, const_cast&lt;wchar_t*&gt;(filename.c_str()), NULL, &amp;pidlShellItem, NULL);

	SHCOLUMNID columnId;
	columnId.fmtid = FMTID_SummaryInformation;
	columnId.pid = PIDSI_TITLE;
	VARIANT variant;
	pFolder-&gt;GetDetailsEx(pidlShellItem, &amp;columnId, &amp;variant);

	pMalloc-&gt;Free(pidlShellItem);
	pMalloc-&gt;Release();
	pFolder-&gt;Release();
	pDesktopFolder-&gt;Release();

	return variant.bstrVal;
}

int main()
{
	OleInitialize(NULL);
	std::wcout &lt;&lt; getTitle(L&quot;C:\\&quot;, L&quot;test.pdf&quot;) &lt;&lt; '\n';
}
</code></pre>
<p>Der Code braucht natürlich noch eine Überarbeitung, speziell in Sachen Fehlerbehandlung.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1492788</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1492788</guid><dc:creator><![CDATA[mr]]></dc:creator><pubDate>Wed, 16 Apr 2008 08:38:31 GMT</pubDate></item></channel></rss>