<?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[Wie kann man von TPaintBox erben?]]></title><description><![CDATA[<p>hallo zusammen<br />
ich möchte folgendes erreichen, eine Klasse spielfeld (field) die von TPaintBox erbt, aber leider erhalte ich immer die Fehlermeldung</p>
<p>[C++ Fehler] field.h(16): E2113 Virtuelle Funktion 'Field::Field(TComponent *)' verursacht Konflikte mit der Basisklasse 'TPaintBox'</p>
<p>was mache ich da falsch, könnte ein trivialer fehler sein, denn ich bin blutiger anfänger. vielen dank für hinweise</p>
<p>//---------------------------------------------------------------------------</p>
<p>#ifndef fieldH<br />
#define fieldH<br />
//---------------------------------------------------------------------------<br />
#endif<br />
#include &lt;vcl.h&gt;<br />
#include &lt;ExtCtrls.hpp&gt;</p>
<p>class Field : <strong>public TPaintBox{</strong><br />
private:<br />
int x1;<br />
int y1;<br />
int x2;<br />
int y2;<br />
public:<br />
Field(TComponent *AOwner);<br />
};</p>
<p>#pragma hdrstop<br />
#include &quot;field.h&quot;<br />
//---------------------------------------------------------------------------<br />
#pragma package(smart_init)</p>
<p>Field::Field(TComponent* AOwner):<br />
TPaintBox(AOwner)<br />
{<br />
x1 = 10;<br />
y1 = 10;<br />
x2 = 100;<br />
y2 = 100;<br />
this-&gt;Left = x1;<br />
this-&gt;Top = y1;<br />
this-&gt;Width = (x2 - x1);<br />
this-&gt;Height = (y2 - y1);<br />
this-&gt;Color = clBlue;<br />
this-&gt;Canvas-&gt;Rectangle(1,1,50,50);<br />
this-&gt;Refresh();<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/79453/wie-kann-man-von-tpaintbox-erben</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 03:28:26 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/79453.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 11 Jul 2004 15:47:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wie kann man von TPaintBox erben? on Sun, 11 Jul 2004 15:47:25 GMT]]></title><description><![CDATA[<p>hallo zusammen<br />
ich möchte folgendes erreichen, eine Klasse spielfeld (field) die von TPaintBox erbt, aber leider erhalte ich immer die Fehlermeldung</p>
<p>[C++ Fehler] field.h(16): E2113 Virtuelle Funktion 'Field::Field(TComponent *)' verursacht Konflikte mit der Basisklasse 'TPaintBox'</p>
<p>was mache ich da falsch, könnte ein trivialer fehler sein, denn ich bin blutiger anfänger. vielen dank für hinweise</p>
<p>//---------------------------------------------------------------------------</p>
<p>#ifndef fieldH<br />
#define fieldH<br />
//---------------------------------------------------------------------------<br />
#endif<br />
#include &lt;vcl.h&gt;<br />
#include &lt;ExtCtrls.hpp&gt;</p>
<p>class Field : <strong>public TPaintBox{</strong><br />
private:<br />
int x1;<br />
int y1;<br />
int x2;<br />
int y2;<br />
public:<br />
Field(TComponent *AOwner);<br />
};</p>
<p>#pragma hdrstop<br />
#include &quot;field.h&quot;<br />
//---------------------------------------------------------------------------<br />
#pragma package(smart_init)</p>
<p>Field::Field(TComponent* AOwner):<br />
TPaintBox(AOwner)<br />
{<br />
x1 = 10;<br />
y1 = 10;<br />
x2 = 100;<br />
y2 = 100;<br />
this-&gt;Left = x1;<br />
this-&gt;Top = y1;<br />
this-&gt;Width = (x2 - x1);<br />
this-&gt;Height = (y2 - y1);<br />
this-&gt;Color = clBlue;<br />
this-&gt;Canvas-&gt;Rectangle(1,1,50,50);<br />
this-&gt;Refresh();<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/558154</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/558154</guid><dc:creator><![CDATA[silver92]]></dc:creator><pubDate>Sun, 11 Jul 2004 15:47:25 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann man von TPaintBox erben? on Mon, 12 Jul 2004 00:08:21 GMT]]></title><description><![CDATA[<p>Sieh dir mal die sonst übliche Deklaration des Konstruktors von VCL-Klassen an, z.B. den in einer Form-Unit.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/558473</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/558473</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Mon, 12 Jul 2004 00:08:21 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann man von TPaintBox erben? on Mon, 12 Jul 2004 21:55:04 GMT]]></title><description><![CDATA[<p>Jansen schrieb:</p>
<blockquote>
<p>Sieh dir mal die sonst übliche Deklaration des Konstruktors von VCL-Klassen an, z.B. den in einer Form-Unit.</p>
</blockquote>
<p>Declaration:<br />
TForm1(TComponent* Owner);</p>
<p>Implementation:<br />
TForm1::TForm1(TComponent* Owner)<br />
: TForm(Owner)<br />
{</p>
]]></description><link>https://www.c-plusplus.net/forum/post/559217</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/559217</guid><dc:creator><![CDATA[hermes]]></dc:creator><pubDate>Mon, 12 Jul 2004 21:55:04 GMT</pubDate></item></channel></rss>