<?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[exception und dll]]></title><description><![CDATA[<p>hallo leute</p>
<p>in dem beitrag <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-265667-and-highlight-is-dll+exception.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-265667-and-highlight-is-dll+exception.html</a> wird behauptet das das werfen von exceptions als pointer ueber dll grenzen funktioniert. stimmt das nun ?<br />
ich war immer der meinung das man keine exceptions werfen kann.</p>
<p>hintergrund: ich habe 2 applikationen welche eine bestimmte dll, in VC geschrieben, benutzen. eine ist mit VC und die andere mit dem borland builder geschrieben. eleganter finde ich es, wenn ich in ausnahmesituationen eine exception werfen koennte.</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/270730/exception-und-dll</link><generator>RSS for Node</generator><lastBuildDate>Sat, 29 Aug 2026 23:03:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/270730.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 17 Jul 2010 09:19:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to exception und dll on Sat, 17 Jul 2010 09:19:06 GMT]]></title><description><![CDATA[<p>hallo leute</p>
<p>in dem beitrag <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-265667-and-highlight-is-dll+exception.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-265667-and-highlight-is-dll+exception.html</a> wird behauptet das das werfen von exceptions als pointer ueber dll grenzen funktioniert. stimmt das nun ?<br />
ich war immer der meinung das man keine exceptions werfen kann.</p>
<p>hintergrund: ich habe 2 applikationen welche eine bestimmte dll, in VC geschrieben, benutzen. eine ist mit VC und die andere mit dem borland builder geschrieben. eleganter finde ich es, wenn ich in ausnahmesituationen eine exception werfen koennte.</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1927538</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1927538</guid><dc:creator><![CDATA[Meep Meep]]></dc:creator><pubDate>Sat, 17 Jul 2010 09:19:06 GMT</pubDate></item><item><title><![CDATA[Reply to exception und dll on Sat, 17 Jul 2010 14:51:35 GMT]]></title><description><![CDATA[<p>Zwischen VC APP und VC DLL funktioniert es, auch ohne Zeiger zu werfen (kannst ganz normal alles werfen was sonst auch geht).<br />
Zwischen Borland und VC - keine Ahnung. Ausprobieren. Oder bei Borland nachfragen.</p>
<p>Oder das Borland Programm auf VC portieren <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/1927676</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1927676</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sat, 17 Jul 2010 14:51:35 GMT</pubDate></item><item><title><![CDATA[Reply to exception und dll on Sat, 17 Jul 2010 16:50:49 GMT]]></title><description><![CDATA[<p>hustbaer schrieb:</p>
<blockquote>
<p>Oder das Borland Programm auf VC portieren <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>
</blockquote>
<p>Oder das VC-Programm nach C++Builder portieren <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="😉"
    /> Das scheint mir ohnehin sinnvoller, da die Primäranwendung ja in C++Builder geschrieben ist.<br />
Warum wird die DLL denn mit VC übersetzt?</p>
<p>Du kannst vermutlich schon Exceptions über Modulgrenzen hinweg werfen - C++Builder benutzt den SEH-Support von Windows für Exceptions, und VC vermutlich auch -, aber dann kommen sie auf der jeweils anderen Seite als &quot;External Exception&quot; an, was meistens nicht das ist, was du dir erhoffst.</p>
<p>Der saubere Weg, um Exceptions über diese Grenze zu befördern, wäre eine COM-Schnittstelle mit <em>safecall</em>-Funktionen. Vermutlich wird das von der ATL auch in irgendeiner Weise unterstützt und erleichtert, aber wirklich Spaß macht es in C++ nicht, weil du dauernd so etwas machen mußt:</p>
<pre><code class="language-cpp">HRESULT MyImpl::MyFunction (int arg, int* result)
{
  try
  {
    /* actual implementation */
    return S_OK;
  }
  catch (const std::exception&amp; e)
  {
    return AtlReportError (classId, e.what (), __uuidof (IMyIntf), 0);
  }
  catch (...)
  {
    return AtlReportError (classId, &quot;Unknown exception&quot;, __uuidof (IMyIntf), 0);
  }
}
</code></pre>
<p>Für ein oder zwei, von mir aus auch zwanzig oder fünfundzwanzig Funktionen ist das zur Not hinnehmbar. Aber darüberhinaus macht es wirklich keinen Spaß mehr. C++ ist da einfach die falsche Sprache; in Delphi oder C# etwa passiert das praktisch von selbst.</p>
<p><em>Edit:</em> 'const' vergessen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1927730</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1927730</guid><dc:creator><![CDATA[audacia]]></dc:creator><pubDate>Sat, 17 Jul 2010 16:50:49 GMT</pubDate></item><item><title><![CDATA[Reply to exception und dll on Sat, 17 Jul 2010 17:44:01 GMT]]></title><description><![CDATA[<p>audacia schrieb:</p>
<blockquote>
<p>Warum wird die DLL denn mit VC übersetzt?</p>
</blockquote>
<p>weil ich einige klassen verwende die viel MS compilerabhaengigen code inne haben.</p>
<p>mal sehen, vielleicht finde ich noch eine andere brauchbare loesung.</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1927759</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1927759</guid><dc:creator><![CDATA[Meep Meep]]></dc:creator><pubDate>Sat, 17 Jul 2010 17:44:01 GMT</pubDate></item><item><title><![CDATA[Reply to exception und dll on Sat, 17 Jul 2010 18:16:39 GMT]]></title><description><![CDATA[<p>Meep Meep schrieb:</p>
<blockquote>
<p>MS compilerabhaengigen code</p>
</blockquote>
<p>Was heißt das genau? Benutzt du C++/CLI oder Managed C++? Oder irgendeine Bibliothek wie die ATL oder MFC? Oder irgendwelche MS-spezifischen Keywords?</p>
<p>Wenn du beispielsweise ohnehin schon C++/CLI benutzt, könntest du den COM-Export auch damit machen; in diesem Fall handhabt das .NET-Framework das ganze Exception-Wrapping für dich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1927776</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1927776</guid><dc:creator><![CDATA[audacia]]></dc:creator><pubDate>Sat, 17 Jul 2010 18:16:39 GMT</pubDate></item><item><title><![CDATA[Reply to exception und dll on Sun, 18 Jul 2010 04:47:10 GMT]]></title><description><![CDATA[<p>hi</p>
<p>keywords und intrinsics</p>
<p>Meep Meep</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1927930</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1927930</guid><dc:creator><![CDATA[Meep Meep]]></dc:creator><pubDate>Sun, 18 Jul 2010 04:47:10 GMT</pubDate></item></channel></rss>