<?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[ReadDirectoryChangesW loest mehrfach trigger aus...]]></title><description><![CDATA[<p>Hallo zusammen!</p>
<p>Ich benutze grad ReadDirectoryChangesW zum überwachen eines Ordners. Wenn ich dort jedoch eine datei z.B. kopiert, wird gleich 2 mal die funktion im handler ausgeführt. keine ahnung warum. Ich verwende folgende notify parameter:</p>
<p>FILE_NOTIFY_CHANGE_LAST_WRITE<br />
FILE_NOTIFY_CHANGE_CREATION</p>
<p>komisch das ganze!</p>
<p>wenn ich CREATION raus nehme, wird es trotzdem zwei mal ausgelöst. bin total überfragt, warum LAST_WRITE zwei mal triggert, wenn ich eine datei änder oder kopier. mach ich was falsch?</p>
<p>LG</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/232305/readdirectorychangesw-loest-mehrfach-trigger-aus</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 11:49:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/232305.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 21 Jan 2009 11:24:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ReadDirectoryChangesW loest mehrfach trigger aus... on Wed, 21 Jan 2009 11:24:59 GMT]]></title><description><![CDATA[<p>Hallo zusammen!</p>
<p>Ich benutze grad ReadDirectoryChangesW zum überwachen eines Ordners. Wenn ich dort jedoch eine datei z.B. kopiert, wird gleich 2 mal die funktion im handler ausgeführt. keine ahnung warum. Ich verwende folgende notify parameter:</p>
<p>FILE_NOTIFY_CHANGE_LAST_WRITE<br />
FILE_NOTIFY_CHANGE_CREATION</p>
<p>komisch das ganze!</p>
<p>wenn ich CREATION raus nehme, wird es trotzdem zwei mal ausgelöst. bin total überfragt, warum LAST_WRITE zwei mal triggert, wenn ich eine datei änder oder kopier. mach ich was falsch?</p>
<p>LG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1649456</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1649456</guid><dc:creator><![CDATA[Bertram]]></dc:creator><pubDate>Wed, 21 Jan 2009 11:24:59 GMT</pubDate></item><item><title><![CDATA[Reply to ReadDirectoryChangesW loest mehrfach trigger aus... on Wed, 21 Jan 2009 15:31:21 GMT]]></title><description><![CDATA[<p>Wir brauchen mehr Code... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1649658</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1649658</guid><dc:creator><![CDATA[Codefrager]]></dc:creator><pubDate>Wed, 21 Jan 2009 15:31:21 GMT</pubDate></item><item><title><![CDATA[Reply to ReadDirectoryChangesW loest mehrfach trigger aus... on Wed, 21 Jan 2009 18:45:34 GMT]]></title><description><![CDATA[<p>geht klar <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 CMyDirectoryChangeHandler : public CDirectoryChangeHandler
{
public:
      	CMyDirectoryChangeHandler(){}
      	virtual ~CMyDirectoryChangeHandler(){}

protected:
	void On_FileModified(const CString &amp;strFileName)
	{

		cout &lt;&lt; &quot;geht\n&quot;;
	}
};

int main()
{
		CMyDirectoryChangeHandler	handler;
		CDirectoryChangeWatcher		watcher(false);

		////////////////////////////////////////
		DWORD dwChangeFilter = 0UL;
		dwChangeFilter |= FILE_NOTIFY_CHANGE_LAST_WRITE;
		dwChangeFilter |= FILE_NOTIFY_CHANGE_CREATION;
		////////////////////////////////////////

		watcher.WatchDirectory(_T(&quot;C:\\POLLTEST\\EXPORT1&quot;),
                                 dwChangeFilter,
                                 &amp;handler,
                                 TRUE,		//&lt;-- watch sub directories?
								 NULL,		//&lt;-- Include Filter
								 NULL);		//&lt;-- Exclude Filter
		while(1){}
}
</code></pre>
<p>leider sehr unübersichtlich. ich verwende einen wrapper den ich ausm netz hab. der verwendet wiederrum die winapi funktion. ich selbst sprech sie aber leider net an.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1649763</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1649763</guid><dc:creator><![CDATA[Bertram]]></dc:creator><pubDate>Wed, 21 Jan 2009 18:45:34 GMT</pubDate></item></channel></rss>