<?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[Problem mit Timer]]></title><description><![CDATA[<p>Hi,<br />
ich habe ein Problem mit einem Timer. Beim Kompilieren erscheint immer folgender Fehler:<br />
fatal error C1001: INTERNER COMPILER- FEHLER<br />
Voran könnte dies liegen?<br />
Ohne den Timer funktioniert das Kompilieren fehlerlos.<br />
Ich will in einem Zeitabstand von 2 Sekunden mehrere Bilder auf einer Hintergrundbitmap anzeigen lassen.<br />
Der Quellcode sieht so aus:</p>
<p>/////////////////////////////////////////////////////////////////////////////<br />
void CMeinDlg::OnPaint()<br />
{<br />
Bild[0].LoadBitmap(IDB_BITMAP2); //CBitmap-Objekt</p>
<p>CPaintDC dc(this); // Gerätekontext für Zeichnen<br />
CPaintDC* pDC = &amp;dc;<br />
BITMAP bmBackground; //BITMAP-Struktur bm deklarieren<br />
Bild[0].GetObject(sizeof(bmBackground),&amp;bmBackground); //Größe und Adresse von CBitmap Bild[0] --&gt; BITMAP bm<br />
CDC memDC;<br />
memDC.CreateCompatibleDC(pDC); //SpeicherDC initialisieren<br />
memDC.SelectObject(&amp;Bild[0]); //Hintergrundbild --&gt; Speicher<br />
RECT Rect;<br />
GetClientRect(&amp;Rect);<br />
pDC-&gt;StretchBlt(0,0,Rect.right,Rect.bottom,&amp;memDC,0,0,<br />
bmBackground.bmWidth,bmBackground.bmHeight,SRCCOPY);<br />
CDialog::OnPaint();</p>
<p>Bild[1].LoadBitmap(IDB_BITMAP3); //CBitmap-Objekt<br />
Bild[2].LoadBitmap(IDB_BITMAP4); //CBitmap-Objekt</p>
<p>int nXDest=0;<br />
int nYDest=0;<br />
int b=1; // Variable für Bild[zahl]<br />
int c=0;<br />
int e=1;<br />
int f=0; //Variable für bm<br />
int s=0; //Variable für CDC SpeicherDC</p>
<p>//////////////////////////////////////TIMEREINSATZ///////////////////////////////////////////////////////////////////////</p>
<p>SetTimer(ID_TIMER, 2000, NULL); // Timer wird nach 2 Sek ausgelöst</p>
<p>void CMeinDlg::OnTimer(UINT nIDEvent)<br />
{<br />
if (nIDEvent == ID_TIMER)<br />
{</p>
<p>for(c=0;c&lt;=30;c++) {</p>
<p>if(e==1) {</p>
<p>b=1;<br />
e+=1;<br />
f+=1;<br />
s+=1;<br />
nXDest+=2;<br />
nYDest+=2;<br />
}<br />
else {<br />
b=2;<br />
e-=1;<br />
f+=1;<br />
s+=1;<br />
nXDest+=5;<br />
nYDest+=5;</p>
<p>}</p>
<p>BITMAP bm[100];<br />
Bild[b].GetObject( sizeof( bm[f] ), &amp;bm[f] );<br />
CDC SpeicherDC[100];<br />
SpeicherDC[s].CreateCompatibleDC( &amp;dc );<br />
SpeicherDC[s].SelectObject( &amp;Bild[b] );<br />
CRect Rect2;<br />
GetClientRect( &amp;Rect2 );</p>
<p>dc.BitBlt(nXDest,nYDest, bm[f].bmWidth, bm[f].bmHeight,<br />
&amp;SpeicherDC[s],0,0,SRCAND);</p>
<p>CDialog::OnPaint();</p>
<p>}</p>
<p>KillTimer(ID_TIMER);<br />
}<br />
}<br />
}<br />
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////</p>
<p>Bitte helft mir!<br />
Schon einmal Danke im Vorraus!<br />
Gruß Crabbe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/50782/problem-mit-timer</link><generator>RSS for Node</generator><lastBuildDate>Sun, 31 May 2026 09:06:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/50782.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 03 Oct 2003 11:29:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit Timer on Fri, 03 Oct 2003 11:29:12 GMT]]></title><description><![CDATA[<p>Hi,<br />
ich habe ein Problem mit einem Timer. Beim Kompilieren erscheint immer folgender Fehler:<br />
fatal error C1001: INTERNER COMPILER- FEHLER<br />
Voran könnte dies liegen?<br />
Ohne den Timer funktioniert das Kompilieren fehlerlos.<br />
Ich will in einem Zeitabstand von 2 Sekunden mehrere Bilder auf einer Hintergrundbitmap anzeigen lassen.<br />
Der Quellcode sieht so aus:</p>
<p>/////////////////////////////////////////////////////////////////////////////<br />
void CMeinDlg::OnPaint()<br />
{<br />
Bild[0].LoadBitmap(IDB_BITMAP2); //CBitmap-Objekt</p>
<p>CPaintDC dc(this); // Gerätekontext für Zeichnen<br />
CPaintDC* pDC = &amp;dc;<br />
BITMAP bmBackground; //BITMAP-Struktur bm deklarieren<br />
Bild[0].GetObject(sizeof(bmBackground),&amp;bmBackground); //Größe und Adresse von CBitmap Bild[0] --&gt; BITMAP bm<br />
CDC memDC;<br />
memDC.CreateCompatibleDC(pDC); //SpeicherDC initialisieren<br />
memDC.SelectObject(&amp;Bild[0]); //Hintergrundbild --&gt; Speicher<br />
RECT Rect;<br />
GetClientRect(&amp;Rect);<br />
pDC-&gt;StretchBlt(0,0,Rect.right,Rect.bottom,&amp;memDC,0,0,<br />
bmBackground.bmWidth,bmBackground.bmHeight,SRCCOPY);<br />
CDialog::OnPaint();</p>
<p>Bild[1].LoadBitmap(IDB_BITMAP3); //CBitmap-Objekt<br />
Bild[2].LoadBitmap(IDB_BITMAP4); //CBitmap-Objekt</p>
<p>int nXDest=0;<br />
int nYDest=0;<br />
int b=1; // Variable für Bild[zahl]<br />
int c=0;<br />
int e=1;<br />
int f=0; //Variable für bm<br />
int s=0; //Variable für CDC SpeicherDC</p>
<p>//////////////////////////////////////TIMEREINSATZ///////////////////////////////////////////////////////////////////////</p>
<p>SetTimer(ID_TIMER, 2000, NULL); // Timer wird nach 2 Sek ausgelöst</p>
<p>void CMeinDlg::OnTimer(UINT nIDEvent)<br />
{<br />
if (nIDEvent == ID_TIMER)<br />
{</p>
<p>for(c=0;c&lt;=30;c++) {</p>
<p>if(e==1) {</p>
<p>b=1;<br />
e+=1;<br />
f+=1;<br />
s+=1;<br />
nXDest+=2;<br />
nYDest+=2;<br />
}<br />
else {<br />
b=2;<br />
e-=1;<br />
f+=1;<br />
s+=1;<br />
nXDest+=5;<br />
nYDest+=5;</p>
<p>}</p>
<p>BITMAP bm[100];<br />
Bild[b].GetObject( sizeof( bm[f] ), &amp;bm[f] );<br />
CDC SpeicherDC[100];<br />
SpeicherDC[s].CreateCompatibleDC( &amp;dc );<br />
SpeicherDC[s].SelectObject( &amp;Bild[b] );<br />
CRect Rect2;<br />
GetClientRect( &amp;Rect2 );</p>
<p>dc.BitBlt(nXDest,nYDest, bm[f].bmWidth, bm[f].bmHeight,<br />
&amp;SpeicherDC[s],0,0,SRCAND);</p>
<p>CDialog::OnPaint();</p>
<p>}</p>
<p>KillTimer(ID_TIMER);<br />
}<br />
}<br />
}<br />
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////</p>
<p>Bitte helft mir!<br />
Schon einmal Danke im Vorraus!<br />
Gruß Crabbe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/365366</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/365366</guid><dc:creator><![CDATA[Crabbe]]></dc:creator><pubDate>Fri, 03 Oct 2003 11:29:12 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Timer on Fri, 03 Oct 2003 16:40:30 GMT]]></title><description><![CDATA[<p>Ich bin mir ja nicht sicher aber ich würde mal tippen du hast was geändert in den mitgelieferten cpp's von Microsoft. Oder heist dein Basisdialog wirklich auch CDialog??. Wenn du was geändert hast mach das schnell wieder rückgängig und kill den Timer beim zerstören deiner eigenen Klasse.</p>
<p>Der Compilerfehler, so ich das richtig sehe, rührt daher, daß ID_TIMER in der Klasse von Microsoft wohl unbekannt ist</p>
]]></description><link>https://www.c-plusplus.net/forum/post/365550</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/365550</guid><dc:creator><![CDATA[Suchthaufen]]></dc:creator><pubDate>Fri, 03 Oct 2003 16:40:30 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Timer on Fri, 03 Oct 2003 20:36:57 GMT]]></title><description><![CDATA[<p>Hi,<br />
erst einmal Danke, aber ich habe in den cpp's nichts verändert und wäre ID_TIMER der Klasse von Microsoft unbekannt, so hätte dies der Kompiler doch angezeigt etwa mit &quot;ID_TIMER&quot; nicht deklarierter Bezeichner.<br />
Oder nicht?</p>
<p>Gru? Crabbe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/365639</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/365639</guid><dc:creator><![CDATA[Crabbe]]></dc:creator><pubDate>Fri, 03 Oct 2003 20:36:57 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Timer on Fri, 03 Oct 2003 23:49:50 GMT]]></title><description><![CDATA[<p>Du kannst deine OnTimer nicht in die OnInitDialog reinschreiben!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/365684</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/365684</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Fri, 03 Oct 2003 23:49:50 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Timer on Sat, 04 Oct 2003 06:20:47 GMT]]></title><description><![CDATA[<p>CDialog ist eindeutig eine Klasse von Microsoft. Wenn du deine Klasse genauso genannt hast, dann änder den Namen. Sowas führt immer zu Komplikationen. Mach den Killtimer rein in void CMeinDlg::~CMeinDlg() oder in Destroy von CMeinDlg. Grundsätzlich ist es ratsam Objekte die du angelegt hast (und ein Timer ist ein Objekt) auch in der selben Klasse wieder zu zerstören.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/365698</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/365698</guid><dc:creator><![CDATA[Suchthaufen]]></dc:creator><pubDate>Sat, 04 Oct 2003 06:20:47 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Timer on Sat, 04 Oct 2003 09:08:10 GMT]]></title><description><![CDATA[<p>Suchthaufen:<br />
Was laberst du da für nen Quatsch? Seine Klasse heisst CMeinDlg!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/365729</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/365729</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Sat, 04 Oct 2003 09:08:10 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Timer on Sat, 04 Oct 2003 10:36:54 GMT]]></title><description><![CDATA[<p>[quote=&quot;dEUs&quot;]Du kannst deine OnTimer nicht in die OnInitDialog reinschreiben![/quote]<br />
Wo dann?<br />
Wie müsste der Quellcode aussehen?</p>
<p>Gruß Crabbe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/365768</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/365768</guid><dc:creator><![CDATA[Crabbe]]></dc:creator><pubDate>Sat, 04 Oct 2003 10:36:54 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Timer on Sat, 04 Oct 2003 10:44:32 GMT]]></title><description><![CDATA[<p>Du kannst keine Funktion in eine andere reinschreiben. Die muss ausserhalb stehen. Geh mal auf <a href="http://www.mut.de" rel="nofollow">www.mut.de</a> -&gt; Leseecke -&gt; VC++ 6.0 in 21 Tagen und lies dir das durch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/365772</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/365772</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Sat, 04 Oct 2003 10:44:32 GMT</pubDate></item></channel></rss>