<?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[Hilfe C2512: &#x27;CTabBasisPage&#x27;: Kein geeigneter Standardkonstruktor verfügbar]]></title><description><![CDATA[<p>ich habe ein Dialog erstellt in dem ich ein Tab Control eingefügt habe.<br />
Doch da die Seitenanzahl zur Laufzeit bekannt wird. Hab ich jetzt eine Klasse namens tabBasisPage abgeleite von CPropertySheet erstellt in ihr sind 2 Variablen von den jeweiligen typ von dialog welches auf der seite angezeigt werden soll. Da ich auch erst zur Laufzeit weis welcher dieser Dialoge auf welcher Seite angezeigt werden soll kann ich sie nicht beide in den konstruktor Packen.<br />
nun sollte das Auswählen des Dialoges die Klasse von Tab Control übernehmen und hab die Beiden Konstruktoren (wieso die Klasse 2 Konstruktoren hat weis ich auch nicht!) von der CPropertySheet leer gelassen.<br />
Aber Irgendwie Klappt das alles nicht! <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>
<pre><code>CMyTabCtrl.H

#if !defined(AFX_MYTABCTRL_H__F3E8650F_019C_479F_9E0F_60FE1181F49F__INCLUDED_)
#define AFX_MYTABCTRL_H__F3E8650F_019C_479F_9E0F_60FE1181F49F__INCLUDED_

#if _MSC_VER &gt; 1000
#pragma once
#endif // _MSC_VER &gt; 1000
// MyTabCtrl.h : header file
//
#include &quot;TabBasisPage.h&quot;
/////////////////////////////////////////////////////////////////////////////
// CMyTabCtrl window

class CMyTabCtrl : public CTabCtrl
{
// Construction
public:
	CMyTabCtrl();

	int m_tabCurrent;
	int m_nNumberOfPages;
	CTabBasisPage* m_tabPages;

// Attributes
public:

// Operations
public:
	void Init(int KnGroesse,int *PinNr,CString *StBez);
	void SetRectangle();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMyTabCtrl)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CMyTabCtrl();

	// Generated message map functions
protected:
	//{{AFX_MSG(CMyTabCtrl)
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()

};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MYTABCTRL_H__F3E8650F_019C_479F_9E0F_60FE1181F49F__INCLUDED_)

CMyTabCtrl.cpp

#include &quot;stdafx.h&quot;
#include &quot;KabelstPrüf.h&quot;
#include &quot;MyTabCtrl.h&quot;

#include &quot;TabPageA.h&quot;
#include &quot;TabPageB.h&quot;

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMyTabCtrl

CMyTabCtrl::CMyTabCtrl()
: m_tabPages(NULL)
{
}

CMyTabCtrl::~CMyTabCtrl()
{
	for(int nCount=0; nCount &lt; m_nNumberOfPages; nCount++){
		delete m_tabPages[nCount];
	}
}

void CMyTabCtrl::Init(int KnGroesse,int *PinNr,CString *StBez)
{
	m_nNumberOfPages=KnGroesse;
//Erstellung der Seiten von Tab Control
	m_tabPages=new CTabBasisPage[KnGroesse]; 

	m_tabCurrent=0;
	for(int i=0;i&lt;KnGroesse;i++)
	{
//Auswahl welches Dialog auf der Seite Angezeigt wird
		InsertItem(i,&quot;Anschl.&quot;,i);
		if(i=0)
		{
			m_tabPages[i].m_SeiteA.m_pnPinNr=PinNr;
			m_tabPages[i].m_SeiteA.m_pszStBez=StBez;
			m_tabPages[i].m_SeiteA.Create(IDD_PROPPAGE_A, this);
			m_tabPages[i].m_SeiteA.ShowWindow(SW_SHOW);
			m_tabPages[i].ShowWindow(SW_SHOW);
		}
		else
		{
			m_tabPages[i].m_SeiteB.m_pnPinNr=PinNr;
			m_tabPages[i].m_SeiteB.m_pszStBez=StBez;
			m_tabPages[i].m_SeiteB.Create(IDD_PROPPAGE_B, this);
			m_tabPages[i].m_SeiteB.ShowWindow(SW_SHOW);
			m_tabPages[i].ShowWindow(SW_HIDE);
		}
	}
	SetRectangle();
}

void CMyTabCtrl::SetRectangle()
{
	CRect tabRect, itemRect;
	int nX, nY, nXc, nYc;

	GetClientRect(&amp;tabRect);
	GetItemRect(0, &amp;itemRect);

	nX=itemRect.left;
	nY=itemRect.bottom+1;
	nXc=tabRect.right-itemRect.left-1;
	nYc=tabRect.bottom-nY-1;

	m_tabPages[0].m_SeiteA.SetWindowPos(&amp;wndTop, nX, nY, nXc, nYc, SWP_SHOWWINDOW);
	for(int nCount=1; nCount &lt; m_nNumberOfPages; nCount++){
		m_tabPages[nCount].m_SeiteB.SetWindowPos(&amp;wndTop, nX, nY, nXc, nYc, SWP_HIDEWINDOW);
	}
}

BEGIN_MESSAGE_MAP(CMyTabCtrl, CTabCtrl)
	//{{AFX_MSG_MAP(CMyTabCtrl)
	ON_WM_LBUTTONDOWN()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyTabCtrl message handlers

void CMyTabCtrl::OnLButtonDown(UINT nFlags, CPoint point) 
{
	CTabCtrl::OnLButtonDown(nFlags, point);

	if(m_tabCurrent != GetCurFocus()){
		m_tabPages[m_tabCurrent].ShowWindow(SW_HIDE);
		m_tabCurrent=GetCurFocus();
		if(m_tabCurrent!=0)
		{
		m_tabPages[m_tabCurrent].m_SeiteB.m_nKnPos=m_tabCurrent;
		}
		m_tabPages[m_tabCurrent].ShowWindow(SW_SHOW);
		m_tabPages[m_tabCurrent].SetFocus();
	}
}
</code></pre>
<p>Danke im vorraus<br />
MfC bzw. MfG<br />
Twist</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/70420/hilfe-c2512-ctabbasispage-kein-geeigneter-standardkonstruktor-verfügbar</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 03:43:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/70420.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 07 Apr 2004 13:17:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hilfe C2512: &#x27;CTabBasisPage&#x27;: Kein geeigneter Standardkonstruktor verfügbar on Wed, 07 Apr 2004 13:17:47 GMT]]></title><description><![CDATA[<p>ich habe ein Dialog erstellt in dem ich ein Tab Control eingefügt habe.<br />
Doch da die Seitenanzahl zur Laufzeit bekannt wird. Hab ich jetzt eine Klasse namens tabBasisPage abgeleite von CPropertySheet erstellt in ihr sind 2 Variablen von den jeweiligen typ von dialog welches auf der seite angezeigt werden soll. Da ich auch erst zur Laufzeit weis welcher dieser Dialoge auf welcher Seite angezeigt werden soll kann ich sie nicht beide in den konstruktor Packen.<br />
nun sollte das Auswählen des Dialoges die Klasse von Tab Control übernehmen und hab die Beiden Konstruktoren (wieso die Klasse 2 Konstruktoren hat weis ich auch nicht!) von der CPropertySheet leer gelassen.<br />
Aber Irgendwie Klappt das alles nicht! <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>
<pre><code>CMyTabCtrl.H

#if !defined(AFX_MYTABCTRL_H__F3E8650F_019C_479F_9E0F_60FE1181F49F__INCLUDED_)
#define AFX_MYTABCTRL_H__F3E8650F_019C_479F_9E0F_60FE1181F49F__INCLUDED_

#if _MSC_VER &gt; 1000
#pragma once
#endif // _MSC_VER &gt; 1000
// MyTabCtrl.h : header file
//
#include &quot;TabBasisPage.h&quot;
/////////////////////////////////////////////////////////////////////////////
// CMyTabCtrl window

class CMyTabCtrl : public CTabCtrl
{
// Construction
public:
	CMyTabCtrl();

	int m_tabCurrent;
	int m_nNumberOfPages;
	CTabBasisPage* m_tabPages;

// Attributes
public:

// Operations
public:
	void Init(int KnGroesse,int *PinNr,CString *StBez);
	void SetRectangle();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMyTabCtrl)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CMyTabCtrl();

	// Generated message map functions
protected:
	//{{AFX_MSG(CMyTabCtrl)
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()

};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MYTABCTRL_H__F3E8650F_019C_479F_9E0F_60FE1181F49F__INCLUDED_)

CMyTabCtrl.cpp

#include &quot;stdafx.h&quot;
#include &quot;KabelstPrüf.h&quot;
#include &quot;MyTabCtrl.h&quot;

#include &quot;TabPageA.h&quot;
#include &quot;TabPageB.h&quot;

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMyTabCtrl

CMyTabCtrl::CMyTabCtrl()
: m_tabPages(NULL)
{
}

CMyTabCtrl::~CMyTabCtrl()
{
	for(int nCount=0; nCount &lt; m_nNumberOfPages; nCount++){
		delete m_tabPages[nCount];
	}
}

void CMyTabCtrl::Init(int KnGroesse,int *PinNr,CString *StBez)
{
	m_nNumberOfPages=KnGroesse;
//Erstellung der Seiten von Tab Control
	m_tabPages=new CTabBasisPage[KnGroesse]; 

	m_tabCurrent=0;
	for(int i=0;i&lt;KnGroesse;i++)
	{
//Auswahl welches Dialog auf der Seite Angezeigt wird
		InsertItem(i,&quot;Anschl.&quot;,i);
		if(i=0)
		{
			m_tabPages[i].m_SeiteA.m_pnPinNr=PinNr;
			m_tabPages[i].m_SeiteA.m_pszStBez=StBez;
			m_tabPages[i].m_SeiteA.Create(IDD_PROPPAGE_A, this);
			m_tabPages[i].m_SeiteA.ShowWindow(SW_SHOW);
			m_tabPages[i].ShowWindow(SW_SHOW);
		}
		else
		{
			m_tabPages[i].m_SeiteB.m_pnPinNr=PinNr;
			m_tabPages[i].m_SeiteB.m_pszStBez=StBez;
			m_tabPages[i].m_SeiteB.Create(IDD_PROPPAGE_B, this);
			m_tabPages[i].m_SeiteB.ShowWindow(SW_SHOW);
			m_tabPages[i].ShowWindow(SW_HIDE);
		}
	}
	SetRectangle();
}

void CMyTabCtrl::SetRectangle()
{
	CRect tabRect, itemRect;
	int nX, nY, nXc, nYc;

	GetClientRect(&amp;tabRect);
	GetItemRect(0, &amp;itemRect);

	nX=itemRect.left;
	nY=itemRect.bottom+1;
	nXc=tabRect.right-itemRect.left-1;
	nYc=tabRect.bottom-nY-1;

	m_tabPages[0].m_SeiteA.SetWindowPos(&amp;wndTop, nX, nY, nXc, nYc, SWP_SHOWWINDOW);
	for(int nCount=1; nCount &lt; m_nNumberOfPages; nCount++){
		m_tabPages[nCount].m_SeiteB.SetWindowPos(&amp;wndTop, nX, nY, nXc, nYc, SWP_HIDEWINDOW);
	}
}

BEGIN_MESSAGE_MAP(CMyTabCtrl, CTabCtrl)
	//{{AFX_MSG_MAP(CMyTabCtrl)
	ON_WM_LBUTTONDOWN()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyTabCtrl message handlers

void CMyTabCtrl::OnLButtonDown(UINT nFlags, CPoint point) 
{
	CTabCtrl::OnLButtonDown(nFlags, point);

	if(m_tabCurrent != GetCurFocus()){
		m_tabPages[m_tabCurrent].ShowWindow(SW_HIDE);
		m_tabCurrent=GetCurFocus();
		if(m_tabCurrent!=0)
		{
		m_tabPages[m_tabCurrent].m_SeiteB.m_nKnPos=m_tabCurrent;
		}
		m_tabPages[m_tabCurrent].ShowWindow(SW_SHOW);
		m_tabPages[m_tabCurrent].SetFocus();
	}
}
</code></pre>
<p>Danke im vorraus<br />
MfC bzw. MfG<br />
Twist</p>
]]></description><link>https://www.c-plusplus.net/forum/post/496913</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/496913</guid><dc:creator><![CDATA[Twist]]></dc:creator><pubDate>Wed, 07 Apr 2004 13:17:47 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe C2512: &#x27;CTabBasisPage&#x27;: Kein geeigneter Standardkonstruktor verfügbar on Wed, 07 Apr 2004 14:52:11 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>du erstellst hier:</p>
<pre><code class="language-cpp">m_tabPages=new CTabBasisPage[KnGroesse];
</code></pre>
<p>ein Array von CTabBasisPage's, das geht aber nur, wenn die Klasse CTabBasisPage einen Standard-Konstruktor hat (also einen, der auch ohne Argumente aufgerufen werden kann)</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/496992</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/496992</guid><dc:creator><![CDATA[Probe-Nutzer]]></dc:creator><pubDate>Wed, 07 Apr 2004 14:52:11 GMT</pubDate></item></channel></rss>