<?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[Service und Timer]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich schreib zur Zeit einen Service, der züglich seine konfigurierten Jobs überprüfen soll. Jedoch finde ich keinen Ansatz, wie ich einen Timer dort rein bekommen soll. SetTimer funktioniert ja nicht wirklich, da ich ja kein Fenster habe oder muss ich mir jetzt extra ein Fenster erstellen, nur für diesen Timer?<br />
Ich wäre für einen Ansatz sehr dankbar.</p>
<p>Danke<br />
Damion</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/69166/service-und-timer</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 17:03:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/69166.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 24 Mar 2004 21:35:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Service und Timer on Wed, 24 Mar 2004 21:35:48 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich schreib zur Zeit einen Service, der züglich seine konfigurierten Jobs überprüfen soll. Jedoch finde ich keinen Ansatz, wie ich einen Timer dort rein bekommen soll. SetTimer funktioniert ja nicht wirklich, da ich ja kein Fenster habe oder muss ich mir jetzt extra ein Fenster erstellen, nur für diesen Timer?<br />
Ich wäre für einen Ansatz sehr dankbar.</p>
<p>Danke<br />
Damion</p>
]]></description><link>https://www.c-plusplus.net/forum/post/488183</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/488183</guid><dc:creator><![CDATA[Damion]]></dc:creator><pubDate>Wed, 24 Mar 2004 21:35:48 GMT</pubDate></item><item><title><![CDATA[Reply to Service und Timer on Wed, 24 Mar 2004 22:01:44 GMT]]></title><description><![CDATA[<p>Bei SetTimer kannst du doch eine Callback-Funktion angeben, ohne Fenster.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/488201</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/488201</guid><dc:creator><![CDATA[callback]]></dc:creator><pubDate>Wed, 24 Mar 2004 22:01:44 GMT</pubDate></item><item><title><![CDATA[Reply to Service und Timer on Thu, 25 Mar 2004 05:52:36 GMT]]></title><description><![CDATA[<p>Danke,</p>
<p>das war das typische Brett vor dem Kopf.</p>
<p>Damion</p>
]]></description><link>https://www.c-plusplus.net/forum/post/488239</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/488239</guid><dc:creator><![CDATA[Damion]]></dc:creator><pubDate>Thu, 25 Mar 2004 05:52:36 GMT</pubDate></item><item><title><![CDATA[Reply to Service und Timer on Thu, 15 Apr 2004 21:04:31 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe das selbe Problem und hab dazu noch eine Frage. Wenn ich einen Timer ohne Window erstelle, dann muss ich denoch einen MessageDispatcher machen, oder? Muss ich denn jetzt wirklich einen neuen Thread erstellen, um dort den Timer laufen zu lassen da der Service ja seinen eigenen Dispatcher. Ich bekomm das ohne neuen Thread nicht zum laufen. Einer ne Idee???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/502267</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/502267</guid><dc:creator><![CDATA[Hmmmmmmm]]></dc:creator><pubDate>Thu, 15 Apr 2004 21:04:31 GMT</pubDate></item><item><title><![CDATA[Reply to Service und Timer on Thu, 15 Apr 2004 21:08:56 GMT]]></title><description><![CDATA[<p>Nein, brauchst du nicht. Du gibst eine Callback-Funktion an. Die wird ohne Umwege aufgerufen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/502270</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/502270</guid><dc:creator><![CDATA[SetTimer]]></dc:creator><pubDate>Thu, 15 Apr 2004 21:08:56 GMT</pubDate></item><item><title><![CDATA[Reply to Service und Timer on Fri, 16 Apr 2004 10:33:38 GMT]]></title><description><![CDATA[<p>Ich bekomm das irgendwie nicht zum laufen, kann mir einer helfen, ich habe mir dazu mal eine kleine Testapplikation geschrieben, wo mach ich da was falsch??</p>
<pre><code>#include &lt;windows.h&gt;

void CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime );

HANDLE hDoForever;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
	HWND hwndTimer;   // handle to window for timer messages 
	MSG msg;          // message structure 
	SetTimer(0, 1024, 1, TimerProc);

	hDoForever = OpenEvent(SYNCHRONIZE, FALSE, &quot;sfdafRunEvt&quot;);
	hDoForever = CreateEvent( NULL, FALSE, FALSE, &quot;sfdafRunEvt&quot;);

	WaitForSingleObject(hDoForever, INFINITE);
	return 0;
}
void CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime )
{
	int i = 0;
	i = i;
}
</code></pre>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/502561</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/502561</guid><dc:creator><![CDATA[Hmmmmmmm]]></dc:creator><pubDate>Fri, 16 Apr 2004 10:33:38 GMT</pubDate></item><item><title><![CDATA[Reply to Service und Timer on Fri, 16 Apr 2004 11:02:52 GMT]]></title><description><![CDATA[<p>was geht denn nicht ?</p>
<p>im moment startest du einen timer mit einem intervall von einer millisekunde und in der timerproc initialisiert i mit 0 und setzt i gleich i, ergebniss = 0</p>
<p>ubrigens: zweiten parameter bei settimer kannst du dir schenken<br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/Timers/TimerReference/TimerFunctions/SetTimer.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/Timers/TimerReference/TimerFunctions/SetTimer.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/502581</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/502581</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Fri, 16 Apr 2004 11:02:52 GMT</pubDate></item><item><title><![CDATA[Reply to Service und Timer on Fri, 16 Apr 2004 12:13:57 GMT]]></title><description><![CDATA[<p>Also das i=I ist einfach dafür gedacht gewesen, dort einen Break-Point zu setzen. Es wird jedoch an diesem Punkt nie gestoppt. Ich hab auch schonmal probier dort eine MessageBox einzubauen, für den Fall das ich dort nicht debuggen könnte(was ich mir jedoch nicht vorstellen kann). Auch die MessageBox wurde nie aufgerufen. Mit dem zweitem Parameter hatte ich auch gelesen, habe aber so nach und nach alles asuprobiert worauf mein krankes Hirn gekommen ist <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="🙂"
    /><br />
Hat einer eine Idee was ich falsch mache. Ist wahrscheinlich wieder so was dummes, dass ich mir nachher wieder selber den A**** abbeiße.</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/502644</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/502644</guid><dc:creator><![CDATA[Hmmmmmmm]]></dc:creator><pubDate>Fri, 16 Apr 2004 12:13:57 GMT</pubDate></item><item><title><![CDATA[Reply to Service und Timer on Fri, 16 Apr 2004 12:24:37 GMT]]></title><description><![CDATA[<p>Du brauchst einen Message Loop wie du schon richtig rausgefunden hast. DispatchMessage sorgt nämlich für den Aufruf der Timer-Funktion.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/502654</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/502654</guid><dc:creator><![CDATA[msdn]]></dc:creator><pubDate>Fri, 16 Apr 2004 12:24:37 GMT</pubDate></item><item><title><![CDATA[Reply to Service und Timer on Fri, 16 Apr 2004 12:26:12 GMT]]></title><description><![CDATA[<p>gibt settimer einen wert zurück? was sagt getlasterror() ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/502655</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/502655</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Fri, 16 Apr 2004 12:26:12 GMT</pubDate></item><item><title><![CDATA[Reply to Service und Timer on Fri, 16 Apr 2004 12:26:46 GMT]]></title><description><![CDATA[<p>Hier der Ausschnitt aus der MSDN:</p>
<blockquote>
<p>When you specify a TimerProc callback function, the default window procedure calls the callback function when it processes WM_TIMER. Therefore, you need to dispatch messages in the calling thread, <strong>even when you use TimerProc instead of processing WM_TIMER.</strong></p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/502656</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/502656</guid><dc:creator><![CDATA[msdn]]></dc:creator><pubDate>Fri, 16 Apr 2004 12:26:46 GMT</pubDate></item></channel></rss>