<?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[CFont::DeleteObject Implementierung?]]></title><description><![CDATA[<p>Hi Leute,</p>
<p>mich würde mal interessieren wie die Implementierung dieser Methode aussieht.</p>
<p>In meiner Anwendung habe ich mehrere Klassen die miteinander kommunizieren. Gelegentlich muss eines der Objekte zerstört werden. Allgemein macht man das ja mit &quot;delete object&quot;. Die CFont::DeleteObject-Methode hat mich begeistert <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="🙂"
    /> würde gerne auch solche Methoden für meine Objekte implementieren. Wie gehe ich dabei vor? Kann mir nicht vorstellen wie ich innerhalb eines Objektes(Klasse) dieses Objekt löschen kann. Gibt es nicht -ohne jetzt lang im Verzeichnisbaum nach dieser Datei zu suchen- eine Möglichkeit sich den SourceCode der CFont::DeleteObject-Methode anzuschauen? Über rechte Mousetaste kann ich zwar &quot;gehe zu Definition&quot; oder &quot;gehe zu Deklaration&quot; gelangen, aber deren Implmentierung bleibt mir verborgen!?</p>
<p>Grüße<br />
ToH</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/151139/cfont-deleteobject-implementierung</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Jul 2026 12:34:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/151139.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 23 Jun 2006 13:03:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CFont::DeleteObject Implementierung? on Fri, 23 Jun 2006 13:03:07 GMT]]></title><description><![CDATA[<p>Hi Leute,</p>
<p>mich würde mal interessieren wie die Implementierung dieser Methode aussieht.</p>
<p>In meiner Anwendung habe ich mehrere Klassen die miteinander kommunizieren. Gelegentlich muss eines der Objekte zerstört werden. Allgemein macht man das ja mit &quot;delete object&quot;. Die CFont::DeleteObject-Methode hat mich begeistert <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="🙂"
    /> würde gerne auch solche Methoden für meine Objekte implementieren. Wie gehe ich dabei vor? Kann mir nicht vorstellen wie ich innerhalb eines Objektes(Klasse) dieses Objekt löschen kann. Gibt es nicht -ohne jetzt lang im Verzeichnisbaum nach dieser Datei zu suchen- eine Möglichkeit sich den SourceCode der CFont::DeleteObject-Methode anzuschauen? Über rechte Mousetaste kann ich zwar &quot;gehe zu Definition&quot; oder &quot;gehe zu Deklaration&quot; gelangen, aber deren Implmentierung bleibt mir verborgen!?</p>
<p>Grüße<br />
ToH</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1083792</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083792</guid><dc:creator><![CDATA[toh]]></dc:creator><pubDate>Fri, 23 Jun 2006 13:03:07 GMT</pubDate></item><item><title><![CDATA[Reply to CFont::DeleteObject Implementierung? on Fri, 23 Jun 2006 13:14:44 GMT]]></title><description><![CDATA[<p>Hast du schon mal einen Breakpoint da drauf gesetzt und dann &quot;In Aufruf springen&quot; bzw F11 ausprobiert ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1083801</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083801</guid><dc:creator><![CDATA[isabeau]]></dc:creator><pubDate>Fri, 23 Jun 2006 13:14:44 GMT</pubDate></item><item><title><![CDATA[Reply to CFont::DeleteObject Implementierung? on Fri, 23 Jun 2006 14:37:25 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">class foo
{	
public:

	void KillMe()
	{
		deleteObject(this);
	}
	static void deleteObject(foo *obj)
	{	
		delete obj;
	}
};

int main()
{
	foo *a = new foo();
	a-&gt;KillMe();
	return 0;
}
</code></pre>
<p>Ob das gegen irgend einen Standard verstösst und nur auf jedem 2. Compiler geht weis ich aber gerade nicht :p</p>
<p>enjoy!<br />
/me</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1083860</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083860</guid><dc:creator><![CDATA[das_brot]]></dc:creator><pubDate>Fri, 23 Jun 2006 14:37:25 GMT</pubDate></item><item><title><![CDATA[Reply to CFont::DeleteObject Implementierung? on Fri, 23 Jun 2006 16:28:49 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/12585">@toh</a>: Warum siehst Du nicht einfach nach?<br />
<a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/5639">@das_brot</a>: warum nicht &quot;delete this&quot;?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1083972</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1083972</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Fri, 23 Jun 2006 16:28:49 GMT</pubDate></item><item><title><![CDATA[Reply to CFont::DeleteObject Implementierung? on Fri, 23 Jun 2006 22:03:00 GMT]]></title><description><![CDATA[<p>Weil das IIRC definitiv gegen den Standard ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1084261</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1084261</guid><dc:creator><![CDATA[das_brot]]></dc:creator><pubDate>Fri, 23 Jun 2006 22:03:00 GMT</pubDate></item><item><title><![CDATA[Reply to CFont::DeleteObject Implementierung? on Fri, 23 Jun 2006 22:27:36 GMT]]></title><description><![CDATA[<p>das_brot schrieb:</p>
<blockquote>
<p>Weil das IIRC definitiv gegen den Standard ist.</p>
</blockquote>
<p>Nein das ist erlaubt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1084276</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1084276</guid><dc:creator><![CDATA[falsch!]]></dc:creator><pubDate>Fri, 23 Jun 2006 22:27:36 GMT</pubDate></item><item><title><![CDATA[Reply to CFont::DeleteObject Implementierung? on Sat, 24 Jun 2006 04:10:42 GMT]]></title><description><![CDATA[<p>Wie ist das dann mit:</p>
<pre><code class="language-cpp">int main()
{
    foo a;
    a.KillMe();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1084309</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1084309</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Sat, 24 Jun 2006 04:10:42 GMT</pubDate></item><item><title><![CDATA[Reply to CFont::DeleteObject Implementierung? on Sun, 25 Jun 2006 13:09:58 GMT]]></title><description><![CDATA[<p>Das verstösst definitiv gegen den Standard. Da fehlt return 0; <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /><br />
Im Ernst: Ich weis nicht ob das geht, kann nicht mal jemand nachschauen wie das gemacht ist?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1085105</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1085105</guid><dc:creator><![CDATA[das_brot]]></dc:creator><pubDate>Sun, 25 Jun 2006 13:09:58 GMT</pubDate></item><item><title><![CDATA[Reply to CFont::DeleteObject Implementierung? on Sun, 25 Jun 2006 14:03:46 GMT]]></title><description><![CDATA[<p>CFont ist von CGdiObject abgeleitet und übernimmt DeleteObject.</p>
<pre><code class="language-cpp">HGDIOBJ CGdiObject::Detach()
{
	HGDIOBJ hObject = m_hObject;
	if (hObject != NULL)
	{
		CHandleMap* pMap = afxMapHGDIOBJ(); // don't create if not exist
		if (pMap != NULL)
			pMap-&gt;RemoveHandle(m_hObject);
	}

	m_hObject = NULL;
	return hObject;
}

BOOL CGdiObject::DeleteObject()
{
	if (m_hObject == NULL)
		return FALSE;
	return ::DeleteObject(Detach());
}
</code></pre>
<p>und dann ::DeleteObject</p>
<pre><code class="language-cpp">WINGDIAPI BOOL WINAPI DeleteObject( IN HGDIOBJ);
</code></pre>
<p>Tjo und weiter komm ich nicht. Wie kann man denn die WINAPI anschauen gehen? ^^</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1085157</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1085157</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Sun, 25 Jun 2006 14:03:46 GMT</pubDate></item><item><title><![CDATA[Reply to CFont::DeleteObject Implementierung? on Sun, 25 Jun 2006 18:25:44 GMT]]></title><description><![CDATA[<p>falsch! schrieb:</p>
<blockquote>
<p>das_brot schrieb:</p>
<blockquote>
<p>Weil das IIRC definitiv gegen den Standard ist.</p>
</blockquote>
<p>Nein das ist erlaubt.</p>
</blockquote>
<p>Und wird sogar sehr häufig eingesetzt (z.B. bei &quot;Zählenden Objekten&quot; wie COM-(Wrapper)-Objekte...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1085339</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1085339</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sun, 25 Jun 2006 18:25:44 GMT</pubDate></item></channel></rss>