<?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[Exceptions in VC++]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich hab gerade folgender Maßen versucht eine Exception aufzufangen:</p>
<pre><code class="language-cpp">try {
	i = pB3-&gt;GetCheck();
} catch(std::exception &amp;e) {
	return false;
}
</code></pre>
<p>Sollte so in C++ funktionieren... Aber hier nicht:</p>
<pre><code>C:\Dokumente und Einstellungen\joerg\Desktop\neu\Dialog1.cpp(1503) : error C2653: 'std' : Keine Klasse oder Namespace
C:\Dokumente und Einstellungen\joerg\Desktop\neu\Dialog1.cpp(1503) : error C2061: Syntaxfehler : Bezeichner 'exception'
C:\Dokumente und Einstellungen\joerg\Desktop\neu\Dialog1.cpp(1503) : error C2310: catch-Behandlungsroutine muss einen Typ angeben
C:\Dokumente und Einstellungen\joerg\Desktop\neu\Dialog1.cpp(1508) : error C2317: Der 'try'-Block ab Zeile '1501' besitzt keine catch-Behandlungsroutinen
</code></pre>
<p>Warum kennt er kein std?<br />
Was für ein Typ für catch?<br />
der try-Block hat doch ein catch...?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/163615/exceptions-in-vc</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Jul 2026 10:54:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/163615.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 31 Oct 2006 13:46:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Exceptions in VC++ on Tue, 31 Oct 2006 13:46:12 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich hab gerade folgender Maßen versucht eine Exception aufzufangen:</p>
<pre><code class="language-cpp">try {
	i = pB3-&gt;GetCheck();
} catch(std::exception &amp;e) {
	return false;
}
</code></pre>
<p>Sollte so in C++ funktionieren... Aber hier nicht:</p>
<pre><code>C:\Dokumente und Einstellungen\joerg\Desktop\neu\Dialog1.cpp(1503) : error C2653: 'std' : Keine Klasse oder Namespace
C:\Dokumente und Einstellungen\joerg\Desktop\neu\Dialog1.cpp(1503) : error C2061: Syntaxfehler : Bezeichner 'exception'
C:\Dokumente und Einstellungen\joerg\Desktop\neu\Dialog1.cpp(1503) : error C2310: catch-Behandlungsroutine muss einen Typ angeben
C:\Dokumente und Einstellungen\joerg\Desktop\neu\Dialog1.cpp(1508) : error C2317: Der 'try'-Block ab Zeile '1501' besitzt keine catch-Behandlungsroutinen
</code></pre>
<p>Warum kennt er kein std?<br />
Was für ein Typ für catch?<br />
der try-Block hat doch ein catch...?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1165350</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1165350</guid><dc:creator><![CDATA[joergh]]></dc:creator><pubDate>Tue, 31 Oct 2006 13:46:12 GMT</pubDate></item><item><title><![CDATA[Reply to Exceptions in VC++ on Tue, 31 Oct 2006 13:50:00 GMT]]></title><description><![CDATA[<p>Header: &lt;exception&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1165357</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1165357</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Tue, 31 Oct 2006 13:50:00 GMT</pubDate></item><item><title><![CDATA[Reply to Exceptions in VC++ on Tue, 31 Oct 2006 13:56:39 GMT]]></title><description><![CDATA[<p>Danke!</p>
<p>Klappt trotzdem noch nicht...</p>
<p>Es kompiliert jetzt, die Exception aus dem try-Block wird aber trotzdem nicht abgefangen!</p>
<p>Kann es sein, dass ich die Exception, die geworfen wird, so gar nicht abfangen kann?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1165363</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1165363</guid><dc:creator><![CDATA[joergh]]></dc:creator><pubDate>Tue, 31 Oct 2006 13:56:39 GMT</pubDate></item><item><title><![CDATA[Reply to Exceptions in VC++ on Tue, 31 Oct 2006 14:38:07 GMT]]></title><description><![CDATA[<p>Es kommt ja darauf an von welchem Typ die geworfene Exception ist. Wenn du std::exception im catch abfängst, fängst du nur Exceptions vom Typ std::exception ab (also die, die davon geerbt haben).</p>
<p>Du mußt in die Doku von GetCheck() schauen, welcher Typ geworfen wird.</p>
<p>Wenn dir der Typ unbekannt ist, kannst du im NOTFALL auch ... abfangen.</p>
<pre><code class="language-cpp">try {
    i = pB3-&gt;GetCheck();
} catch(...) {
    return false;
}
</code></pre>
<p>Aber das ist dann wirklich eine Notlösung und ist nur letztes Mittel.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1165395</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1165395</guid><dc:creator><![CDATA[Artchi]]></dc:creator><pubDate>Tue, 31 Oct 2006 14:38:07 GMT</pubDate></item><item><title><![CDATA[Reply to Exceptions in VC++ on Wed, 01 Nov 2006 10:22:28 GMT]]></title><description><![CDATA[<p>Und MFC Klassen werfen afaik lieber Nachkommen von CException als von std::exception (die sind leider nicht miteinander verwandt).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1166037</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1166037</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 01 Nov 2006 10:22:28 GMT</pubDate></item><item><title><![CDATA[Reply to Exceptions in VC++ on Wed, 01 Nov 2006 12:09:03 GMT]]></title><description><![CDATA[<p>Nachtrag: ... und sie werfen Zeiger auf CException die man mit der Memberfunktion Delete bei nicht mehr benötigen entsorgen muss!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1166131</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1166131</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 01 Nov 2006 12:09:03 GMT</pubDate></item></channel></rss>