<?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[Problem mit Mehrfachdeklaration]]></title><description><![CDATA[<p>Hi zusammen,</p>
<p>habe eine Klasse namens &quot;Messungsvorgang&quot;:</p>
<pre><code class="language-cpp">#include &quot;Keithley2000.h&quot;
#include &quot;FormMain.h&quot;
/*----------------------------------------------------------------------------*/
/*Klasse um die Messwerte vom Multimeter auszulesen (Ohm-wert) und dann in ---*/
/*einen Grad-Wert umzurechnen-------------------------------------------------*/

class Messungsvorgang //Hier kommt der Fehler!!!!!!!!!!!!!!!!!!!!!!!
{
public:
TKeithley2000 *DMM;
/*Konstruktor der Klasse &gt; Setzt die richtigen Einstellungen des Multimeters--*/  
__fastcall Messungsvorgang(void);

/*Gibt Messwert zurück--------------------------------------------------------*/
double getMesswert();
};
</code></pre>
<p>Jetzt habe ich ja die FormMain.h eingebunden um quasi auf meine Progressbar zuzugreifen!</p>
<p>Meine FormMain.h:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#ifndef FormMainH
#define FormMainH
//---------------------------------------------------------------------------
#include &lt;Classes.hpp&gt;
#include &lt;Controls.hpp&gt;
#include &lt;StdCtrls.hpp&gt;
#include &lt;Forms.hpp&gt;
#include &quot;Messungsvorgang.h&quot;
#include &lt;ComCtrls.hpp&gt;
#include &lt;Chart.hpp&gt;
#include &lt;ExtCtrls.hpp&gt;
#include &lt;TeEngine.hpp&gt;
#include &lt;TeeProcs.hpp&gt;
#include &lt;Series.hpp&gt;

//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:
   TPageControl *PageControl1;
   TTabSheet *TabMesswerteListe;
   TTabSheet *TabMesswerteGrafik;
   TListBox *MesswerteListe;
   TButton *Messen;
   TChart *MesswertGrafik;
   TFastLineSeries *Series1;
   TLabel *Label1;
   TLabel *AktuellerMesswertLabel;
   TLabel *Label2;
   TLabel *AktuelleMessungLabel;
   TProgressBar *FortschrittBar;
   TLabel *InfoFortschrittLabel;
   void __fastcall MessenClick(TObject *Sender);
private:
public:
   __fastcall TForm1(TComponent* Owner);
    Messungsvorgang *messvorgang;
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
</code></pre>
<p>Jetzt kommen die Fehler:</p>
<p>[C++ Fehler] MESSUNGSVORGANG.H(8): E2238 Bezeichner 'Messungsvorgang' mehrfach deklariert<br />
[C++ Warnung] BasisFunktionen.h(72): W8058 Präcompilierter Header: Initialisierte Daten im Header kann nicht erzeugt werden.</p>
<p>Warum bekomm ich diese Fehler.<br />
Habe ich was falsch gemacht?</p>
<p>Danke Bench</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/206637/problem-mit-mehrfachdeklaration</link><generator>RSS for Node</generator><lastBuildDate>Thu, 20 Aug 2026 01:38:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/206637.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 27 Feb 2008 07:02:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit Mehrfachdeklaration on Wed, 27 Feb 2008 07:04:28 GMT]]></title><description><![CDATA[<p>Hi zusammen,</p>
<p>habe eine Klasse namens &quot;Messungsvorgang&quot;:</p>
<pre><code class="language-cpp">#include &quot;Keithley2000.h&quot;
#include &quot;FormMain.h&quot;
/*----------------------------------------------------------------------------*/
/*Klasse um die Messwerte vom Multimeter auszulesen (Ohm-wert) und dann in ---*/
/*einen Grad-Wert umzurechnen-------------------------------------------------*/

class Messungsvorgang //Hier kommt der Fehler!!!!!!!!!!!!!!!!!!!!!!!
{
public:
TKeithley2000 *DMM;
/*Konstruktor der Klasse &gt; Setzt die richtigen Einstellungen des Multimeters--*/  
__fastcall Messungsvorgang(void);

/*Gibt Messwert zurück--------------------------------------------------------*/
double getMesswert();
};
</code></pre>
<p>Jetzt habe ich ja die FormMain.h eingebunden um quasi auf meine Progressbar zuzugreifen!</p>
<p>Meine FormMain.h:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#ifndef FormMainH
#define FormMainH
//---------------------------------------------------------------------------
#include &lt;Classes.hpp&gt;
#include &lt;Controls.hpp&gt;
#include &lt;StdCtrls.hpp&gt;
#include &lt;Forms.hpp&gt;
#include &quot;Messungsvorgang.h&quot;
#include &lt;ComCtrls.hpp&gt;
#include &lt;Chart.hpp&gt;
#include &lt;ExtCtrls.hpp&gt;
#include &lt;TeEngine.hpp&gt;
#include &lt;TeeProcs.hpp&gt;
#include &lt;Series.hpp&gt;

//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:
   TPageControl *PageControl1;
   TTabSheet *TabMesswerteListe;
   TTabSheet *TabMesswerteGrafik;
   TListBox *MesswerteListe;
   TButton *Messen;
   TChart *MesswertGrafik;
   TFastLineSeries *Series1;
   TLabel *Label1;
   TLabel *AktuellerMesswertLabel;
   TLabel *Label2;
   TLabel *AktuelleMessungLabel;
   TProgressBar *FortschrittBar;
   TLabel *InfoFortschrittLabel;
   void __fastcall MessenClick(TObject *Sender);
private:
public:
   __fastcall TForm1(TComponent* Owner);
    Messungsvorgang *messvorgang;
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
</code></pre>
<p>Jetzt kommen die Fehler:</p>
<p>[C++ Fehler] MESSUNGSVORGANG.H(8): E2238 Bezeichner 'Messungsvorgang' mehrfach deklariert<br />
[C++ Warnung] BasisFunktionen.h(72): W8058 Präcompilierter Header: Initialisierte Daten im Header kann nicht erzeugt werden.</p>
<p>Warum bekomm ich diese Fehler.<br />
Habe ich was falsch gemacht?</p>
<p>Danke Bench</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1463737</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1463737</guid><dc:creator><![CDATA[Bench_XProjects]]></dc:creator><pubDate>Wed, 27 Feb 2008 07:04:28 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Mehrfachdeklaration on Wed, 27 Feb 2008 08:09:48 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Zunächsteinmal sind Kreuzincludes unzulässig.</p>
<pre><code class="language-cpp">// FormMain.h
#include &quot;Messungsvorgang.h&quot;
...

// Messungsvorgang.h
#include &quot;FormMain.h&quot;
...
</code></pre>
<p>Sinnvollerweise sollte nur FormMain.h die Klasse Messungsvorgang einbinden.</p>
<p>Außerdem fehlen in Messungsvorgang.h die Include Guards.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1463755</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1463755</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 27 Feb 2008 08:09:48 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Mehrfachdeklaration on Wed, 27 Feb 2008 08:22:03 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#ifndef
#define
#endif
</code></pre>
<p>Sind das die include-Guards?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1463763</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1463763</guid><dc:creator><![CDATA[Kolumbus]]></dc:creator><pubDate>Wed, 27 Feb 2008 08:22:03 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Mehrfachdeklaration on Wed, 27 Feb 2008 08:26:21 GMT]]></title><description><![CDATA[<p>Yep.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1463766</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1463766</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 27 Feb 2008 08:26:21 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Mehrfachdeklaration on Wed, 27 Feb 2008 08:32:30 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>erstmal danke!!!<br />
ok versteh ich!!<br />
Ist mir auch irgendwie klar.</p>
<p>Ok habe folgendes nun zusätzlich in meine Klasse geschrieben:</p>
<pre><code class="language-cpp">#ifndef MESSUNGSVORGANGH
#define MESSUNGSVORGANGH
....
#endif
</code></pre>
<p>Somit ist die Doppeldeklaration hinfällig, oder!<br />
Weil ja das über die if-Abfrage getestet wird!</p>
<p>Aber wenn nun ein Kreuzinclude schlecht ist, wie kann ich dann auf die elemente der Form aus meiner anderen Klasse zugreifen???<br />
Wie ist es dann formal besser?</p>
<p>Danke Bench</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1463770</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1463770</guid><dc:creator><![CDATA[Bench_XProjects]]></dc:creator><pubDate>Wed, 27 Feb 2008 08:32:30 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Mehrfachdeklaration on Wed, 27 Feb 2008 13:03:14 GMT]]></title><description><![CDATA[<p>Entkopple die Klasse Messungsvorgang von dem Formular, sie hat nichts mit der GUI zu tun. Wenn Du unbedingt eine Progressbar in dieser Klasse schieben willst, dann übergibt die Progressbar an die Klasse oder eine Callback-Funktion.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1463983</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1463983</guid><dc:creator><![CDATA[witte_]]></dc:creator><pubDate>Wed, 27 Feb 2008 13:03:14 GMT</pubDate></item></channel></rss>