<?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[COM-DLL Methoden-Rückgabetyp]]></title><description><![CDATA[<p>Hi!</p>
<p>Ich schreibe gerade eine COM-DLL (ATL) und habe da ein paar Probleme eine Funktion mit dem Rückgabetyp BOOL zu implementieren. Die Funktion erzeuge ich mit den Assistenten der VS 6 IDE, das klappt Bestens:</p>
<pre><code class="language-cpp">STDMETHODIMP_(BOOL) Test::WorkerStop()
{
	// ZU ERLEDIGEN: Implementierungscode hier hinzufügen
	return TRUE;
}
</code></pre>
<p>Alle Einträge - z.B. in die idl-Datei - werden ebenfalls automatisch erzeugt. Beim Kompilieren bekomme ich dann aber immer folgenden Fehler:</p>
<pre><code>error MIDL2269 : procedures in an object interface must return an HRESULT
</code></pre>
<p>Durch Googeln finde ich dazu leider nur diesen Microsoft-Artikel: <a href="http://support.microsoft.com/kb/192626/en-us" rel="nofollow">http://support.microsoft.com/kb/192626/en-us</a>. Offensichtlich gibt es also eine Lösung für das Problem, aber ich verstehe sie nicht: Zitat (RESOLUTION):</p>
<pre><code>Add the [local] attribute to either the interface or the method.
</code></pre>
<p>Kann mir da jemand helfen? Danke!</p>
<p>Sebo</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/184683/com-dll-methoden-rückgabetyp</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 07:25:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/184683.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 Jun 2007 08:00:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to COM-DLL Methoden-Rückgabetyp on Mon, 18 Jun 2007 08:00:17 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>Ich schreibe gerade eine COM-DLL (ATL) und habe da ein paar Probleme eine Funktion mit dem Rückgabetyp BOOL zu implementieren. Die Funktion erzeuge ich mit den Assistenten der VS 6 IDE, das klappt Bestens:</p>
<pre><code class="language-cpp">STDMETHODIMP_(BOOL) Test::WorkerStop()
{
	// ZU ERLEDIGEN: Implementierungscode hier hinzufügen
	return TRUE;
}
</code></pre>
<p>Alle Einträge - z.B. in die idl-Datei - werden ebenfalls automatisch erzeugt. Beim Kompilieren bekomme ich dann aber immer folgenden Fehler:</p>
<pre><code>error MIDL2269 : procedures in an object interface must return an HRESULT
</code></pre>
<p>Durch Googeln finde ich dazu leider nur diesen Microsoft-Artikel: <a href="http://support.microsoft.com/kb/192626/en-us" rel="nofollow">http://support.microsoft.com/kb/192626/en-us</a>. Offensichtlich gibt es also eine Lösung für das Problem, aber ich verstehe sie nicht: Zitat (RESOLUTION):</p>
<pre><code>Add the [local] attribute to either the interface or the method.
</code></pre>
<p>Kann mir da jemand helfen? Danke!</p>
<p>Sebo</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1308182</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1308182</guid><dc:creator><![CDATA[SeboStone]]></dc:creator><pubDate>Mon, 18 Jun 2007 08:00:17 GMT</pubDate></item><item><title><![CDATA[Reply to COM-DLL Methoden-Rückgabetyp on Mon, 18 Jun 2007 08:12:46 GMT]]></title><description><![CDATA[<p>Also frei übersetzt heisst das, dass der Rückgabewert entweder in der Methode oder im Interface deklariert werden soll, aber wie soll das denn funktionieren?!?!?</p>
<p>Soll das vielleicht bedeuten, dass ich den Wert den ich zurückgeben will über einen referenzierten Parameter zurückgeben soll?! Das kann's ja nicht sein, denke ich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1308187</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1308187</guid><dc:creator><![CDATA[SeboStone]]></dc:creator><pubDate>Mon, 18 Jun 2007 08:12:46 GMT</pubDate></item><item><title><![CDATA[Reply to COM-DLL Methoden-Rückgabetyp on Tue, 19 Jun 2007 11:49:47 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-403.html" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-1.html" rel="nofollow">MFC (Visual C++)</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1309046</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1309046</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Tue, 19 Jun 2007 11:49:47 GMT</pubDate></item><item><title><![CDATA[Reply to COM-DLL Methoden-Rückgabetyp on Tue, 19 Jun 2007 12:57:41 GMT]]></title><description><![CDATA[<p>Eine Property oder eine Methode das einen BOOL returniert sieht so aus:</p>
<pre><code class="language-cpp">STDMETHODIMP CComSomething::get_IsSomething(VARIANT_BOOL* pVal)
</code></pre>
<p>Warum lässt Du das ganze nicht durch den MIDL erzegen? Bzw. verwendest ATL?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1309136</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1309136</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 19 Jun 2007 12:57:41 GMT</pubDate></item><item><title><![CDATA[Reply to COM-DLL Methoden-Rückgabetyp on Wed, 20 Jun 2007 05:43:05 GMT]]></title><description><![CDATA[<p>[quote=&quot;C++ Forumbot&quot;]Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-403.html" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-1.html" rel="nofollow">MFC (Visual C++)</a> verschoben.</p>
<p>Diese dll ist ohne MFC ....</p>
<p>Martin Richter schrieb:</p>
<blockquote>
<p>Eine Property oder eine Methode das einen BOOL returniert sieht so aus:</p>
<pre><code class="language-cpp">STDMETHODIMP CComSomething::get_IsSomething(VARIANT_BOOL* pVal)
</code></pre>
<p>Warum lässt Du das ganze nicht durch den MIDL erzegen? Bzw. verwendest ATL?</p>
</blockquote>
<p>Property ist mir bekannt. Mmh, ich erzeuge die Funktionsheader mit den VS 6 - Assistenten ob das MIDL ist weiss ich nicht. ATL verwende ich, weil ich eine COM dll für .NET haben will und ich im Netz keine andere Möglichkeit gefunden habe so eine dll in VS 6 zu erzeugen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1309556</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1309556</guid><dc:creator><![CDATA[SeboStone]]></dc:creator><pubDate>Wed, 20 Jun 2007 05:43:05 GMT</pubDate></item><item><title><![CDATA[Reply to COM-DLL Methoden-Rückgabetyp on Wed, 20 Jun 2007 06:26:32 GMT]]></title><description><![CDATA[<p>Ich versteheimmer noch nicht wie Du es machst!<br />
Verwendest Du die IDisptach implementierung der MFC?<br />
Oder verwendest Du ATL?<br />
Wie sieht Deine idl Datei aus?</p>
<p>Beschätfige Dich mal mit ATL+COM!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1309575</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1309575</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 20 Jun 2007 06:26:32 GMT</pubDate></item><item><title><![CDATA[Reply to COM-DLL Methoden-Rückgabetyp on Wed, 20 Jun 2007 07:23:29 GMT]]></title><description><![CDATA[<p>Martin Richter schrieb:</p>
<blockquote>
<p>Ich versteheimmer noch nicht wie Du es machst!<br />
Verwendest Du die IDisptach implementierung der MFC?<br />
Oder verwendest Du ATL?</p>
</blockquote>
<p>Wenn Du mich so fragst, muss ich gestehen, dass ich es nicht genau weiss. Ich denke ich nutze ATL, denn ich habe bei der Projekterzeugung &quot;&quot;ATL-COM-Anwendungsassistent&quot; gewählt (und dann dll ohne MFC). Habe leider nicht viel Doku bisher gefunden, hast Du dazu vielleicht einen guten Link?</p>
<p>Martin Richter schrieb:</p>
<blockquote>
<p>Wie sieht Deine idl Datei aus?</p>
</blockquote>
<p>Die sieht folgendermassen aus:</p>
<pre><code>import &quot;oaidl.idl&quot;;
import &quot;ocidl.idl&quot;;

	[
		object,
		uuid(3649938F-1A98-4778-A878-342C74BCFBF6),
		helpstring(&quot;ITest Interface&quot;),
		pointer_default(unique)
	]
	interface ITest : IUnknown
	{
		[helpstring(&quot;Methode WorkerStart&quot;)] HRESULT WorkerStart(int seconds);
		[helpstring(&quot;Methode WorkerStop&quot;)] HRESULT WorkerStop();
		[propget, helpstring(&quot;Eigenschaft IsWorking&quot;)] HRESULT IsWorking([out, retval] BOOL *pVal);
		[helpstring(&quot;Methode test&quot;)] BOOL test(int xyz);
	};

[
	uuid(6DC88192-3DDC-4F3B-BA51-F72760C02CAB),
	version(1.0),
	helpstring(&quot;COM 1.0 Typbibliothek&quot;)
]
library COMLib
{
	importlib(&quot;stdole32.tlb&quot;);
	importlib(&quot;stdole2.tlb&quot;);

	typedef enum eWorkerState
	{
		Stop = 0,
		Start = 1
	} WorkerState;

	[
		uuid(7EBC2254-8C8E-4878-8102-7FE8D0C85F14),
		helpstring(&quot;Test Class&quot;)
	]
	coclass Test
	{
		[default] interface ITest;
	};
};
</code></pre>
<p>Als Fehlermeldung bekomme ich an der Stelle mit dem BOOL Rückgabewert folgendes:</p>
<pre><code>COM.idl(15) : error MIDL2269 : procedures in an object interface must return an HRESULT : [ Procedure 'test' ( Interface 'ITest' ) ]
</code></pre>
<p>. Generiert habe ich die Funktion über die Klassenansicht und habe sonst nichts weiter geändert.</p>
<p>Martin Richter schrieb:</p>
<blockquote>
<p>Beschätfige Dich mal mit ATL+COM!</p>
</blockquote>
<p>Das mache ich ja gerade. <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1309617</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1309617</guid><dc:creator><![CDATA[SeboStone]]></dc:creator><pubDate>Wed, 20 Jun 2007 07:23:29 GMT</pubDate></item><item><title><![CDATA[Reply to COM-DLL Methoden-Rückgabetyp on Wed, 20 Jun 2007 08:44:31 GMT]]></title><description><![CDATA[<p>Schredder doch VC6 einfach.</p>
<p>Evtl. ist das dein Problem:<br />
<a href="http://support.microsoft.com/kb/192626" rel="nofollow">http://support.microsoft.com/kb/192626</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1309694</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1309694</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 20 Jun 2007 08:44:31 GMT</pubDate></item><item><title><![CDATA[Reply to COM-DLL Methoden-Rückgabetyp on Wed, 20 Jun 2007 09:19:22 GMT]]></title><description><![CDATA[<p>Martin Richter schrieb:</p>
<blockquote>
<p>Schredder doch VC6 einfach.</p>
</blockquote>
<p>Würde ich sehr gerne, aber es geht um zertifizierte Software, die in neue Technologien importiert werden soll, hab' also keine Wahl. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /></p>
<p>Martin Richter schrieb:</p>
<blockquote>
<p>Evtl. ist das dein Problem:<br />
<a href="http://support.microsoft.com/kb/192626" rel="nofollow">http://support.microsoft.com/kb/192626</a></p>
</blockquote>
<p>Jep, das ist der einzige Link, den ich dazu gefunden hab'. Ich hatte eben nur gehofft, das es doch eine Möglichkeit gäbe das Problem zu umgehen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<p>Danke für Deine Hilfe!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1309722</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1309722</guid><dc:creator><![CDATA[SeboStone]]></dc:creator><pubDate>Wed, 20 Jun 2007 09:19:22 GMT</pubDate></item></channel></rss>