<?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[Einsteiger-Frage: Probleme mit Variablen - Instanzierung]]></title><description><![CDATA[<p>Hallo,</p>
<p>Habe ein relativ simples Problem:</p>
<p>Ich habe 2 Dialogfenster. Das Ergebnis des einen Fensters bräuchte ich in dem andern.</p>
<p>habe folgendes probiert:<br />
CConnect_to_Server connect;<br />
MessageBox(connect.m_kryptkey);</p>
<p>daraus folgt:<br />
error C2039: 'm_kryptkey' : is not a member of 'CConnect_to_Server'<br />
...\Connect_to_Server.h(13) : see declaration of 'CConnect_to_Server'</p>
<p>Werde nur irgendwie nicht so recht schlau draus...<br />
einen #include connect_to_server.h hab ich.</p>
<p>Danke im voraus.</p>
<p>mfg<br />
trequ</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/46459/einsteiger-frage-probleme-mit-variablen-instanzierung</link><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Apr 2026 05:20:00 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/46459.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 19 Aug 2003 21:36:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Einsteiger-Frage: Probleme mit Variablen - Instanzierung on Tue, 19 Aug 2003 21:36:45 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Habe ein relativ simples Problem:</p>
<p>Ich habe 2 Dialogfenster. Das Ergebnis des einen Fensters bräuchte ich in dem andern.</p>
<p>habe folgendes probiert:<br />
CConnect_to_Server connect;<br />
MessageBox(connect.m_kryptkey);</p>
<p>daraus folgt:<br />
error C2039: 'm_kryptkey' : is not a member of 'CConnect_to_Server'<br />
...\Connect_to_Server.h(13) : see declaration of 'CConnect_to_Server'</p>
<p>Werde nur irgendwie nicht so recht schlau draus...<br />
einen #include connect_to_server.h hab ich.</p>
<p>Danke im voraus.</p>
<p>mfg<br />
trequ</p>
]]></description><link>https://www.c-plusplus.net/forum/post/336399</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/336399</guid><dc:creator><![CDATA[trequ]]></dc:creator><pubDate>Tue, 19 Aug 2003 21:36:45 GMT</pubDate></item><item><title><![CDATA[Reply to Einsteiger-Frage: Probleme mit Variablen - Instanzierung on Tue, 19 Aug 2003 22:05:07 GMT]]></title><description><![CDATA[<p>Naja, ich vermute mal Folgendes:</p>
<p>m_kryptkey ist in der Klasse CConnect_to_Server nicht deklariert, oder zumindest nur lokal in einer Schleife oder so.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/336406</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/336406</guid><dc:creator><![CDATA[CrazyOwl]]></dc:creator><pubDate>Tue, 19 Aug 2003 22:05:07 GMT</pubDate></item><item><title><![CDATA[Reply to Einsteiger-Frage: Probleme mit Variablen - Instanzierung on Fri, 22 Aug 2003 12:29:08 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Richtig, da war der Wurm drin.<br />
m_kryptkey ist jetzt in Connect_to_Server public und hat da auch einen Wert.<br />
Jetzt kriege ich zwar beim Starten keinen Fehler mehr, aber wenn ich dann folgendes mache:</p>
<pre><code class="language-cpp">CConnect_to_Server connect; 
MessageBox(connect.m_kryptkey);
</code></pre>
<p>bleibt die Dialogbox leer.<br />
ich nehme mal an dass nach der übergabe kein Wert mehr da ist... nur: Wieso?</p>
<p>mfg<br />
trequ</p>
]]></description><link>https://www.c-plusplus.net/forum/post/338580</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/338580</guid><dc:creator><![CDATA[trequ]]></dc:creator><pubDate>Fri, 22 Aug 2003 12:29:08 GMT</pubDate></item><item><title><![CDATA[Reply to Einsteiger-Frage: Probleme mit Variablen - Instanzierung on Fri, 22 Aug 2003 13:34:47 GMT]]></title><description><![CDATA[<p>Ist CConnect_to_server ein Dialogfeld ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/338626</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/338626</guid><dc:creator><![CDATA[CrazyOwl]]></dc:creator><pubDate>Fri, 22 Aug 2003 13:34:47 GMT</pubDate></item><item><title><![CDATA[Reply to Einsteiger-Frage: Probleme mit Variablen - Instanzierung on Fri, 22 Aug 2003 14:19:49 GMT]]></title><description><![CDATA[<p>Ja, warum?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/338656</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/338656</guid><dc:creator><![CDATA[trequ]]></dc:creator><pubDate>Fri, 22 Aug 2003 14:19:49 GMT</pubDate></item><item><title><![CDATA[Reply to Einsteiger-Frage: Probleme mit Variablen - Instanzierung on Fri, 22 Aug 2003 15:00:57 GMT]]></title><description><![CDATA[<p>trequ schrieb:</p>
<blockquote>
<p>Hallo,</p>
<p>CConnect_to_Server connect;<br />
MessageBox(connect.m_kryptkey);[/cpp]</p>
<p>bleibt die Dialogbox leer.<br />
ich nehme mal an dass nach der übergabe kein Wert mehr da ist... nur: Wieso?</p>
<p>trequ</p>
</blockquote>
<p>was erwartest Du denn Bitte?<br />
aus Deinem Codesnippet kann ich nur ableiten, daß du die Klasse<br />
CConnect_to_Server instanziert hast und Dir über eine MessageBox den<br />
Wert eines members dieser klasse(m_mkryptkey) anzeigen läßt.</p>
<p>Woher sollen die Leute hier wissen, was in deinem Konstruktor steht, oder was Du hier vorhast?</p>
<p>epidemic</p>
]]></description><link>https://www.c-plusplus.net/forum/post/338692</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/338692</guid><dc:creator><![CDATA[epidemic]]></dc:creator><pubDate>Fri, 22 Aug 2003 15:00:57 GMT</pubDate></item><item><title><![CDATA[Reply to Einsteiger-Frage: Probleme mit Variablen - Instanzierung on Fri, 22 Aug 2003 15:29:47 GMT]]></title><description><![CDATA[<p>Weil ich aus deinem Code entnehme, dass das Dialogfeld gar nicht aufgerufen wird. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/338705</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/338705</guid><dc:creator><![CDATA[CrazyOwl]]></dc:creator><pubDate>Fri, 22 Aug 2003 15:29:47 GMT</pubDate></item><item><title><![CDATA[Reply to Einsteiger-Frage: Probleme mit Variablen - Instanzierung on Sat, 23 Aug 2003 08:27:02 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>also hier noch mal der ganze Code:</p>
<p>Datei Connect_to_Server.h</p>
<pre><code class="language-cpp">#if !defined(AFX_CONNECT_TO_SERVER_H__06F55074_FB66_4F47_92A2_C406604402D0__INCLUDED_)
#define AFX_CONNECT_TO_SERVER_H__06F55074_FB66_4F47_92A2_C406604402D0__INCLUDED_

#if _MSC_VER &gt; 1000
#pragma once
#endif // _MSC_VER &gt; 1000
// Connect_to_Server.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CConnect_to_Server dialog

class CConnect_to_Server : public CDialog
{
// Construction
public:
	CConnect_to_Server(CWnd* pParent = NULL);   // standard constructor
// Dialog Data
	//{{AFX_DATA(CConnect_to_Server)
	enum { IDD = IDD_CONNECT_TO_SERVER };
	CProgressCtrl	m_connect_progress;
	CString	m_connectstatus;
	CString m_kryptkey;
	//}}AFX_DATA

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CConnect_to_Server)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CConnect_to_Server)
	virtual void OnCancel();
	afx_msg void OnTimer(UINT nIDEvent);
	virtual BOOL OnInitDialog();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_CONNECT_TO_SERVER_H__06F55074_FB66_4F47_92A2_C406604402D0__INCLUDED_)
</code></pre>
<p>Datei Connect_to_Server.cpp</p>
<pre><code class="language-cpp">// Connect_to_Server.cpp : implementation file
//

#include &quot;stdafx.h&quot;
#include &quot;SecMail.h&quot;
#include &quot;iostream.h&quot; 
#include &quot;fstream.h&quot;
#include &quot;MakeServerLogin.h&quot;
#include &quot;Connect_to_Server.h&quot;

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

/////////////////////////////////////////////////////////////////////////////
// CConnect_to_Server dialog

CConnect_to_Server::CConnect_to_Server(CWnd* pParent /*=NULL*/)
	: CDialog(CConnect_to_Server::IDD, pParent)
{
	//{{AFX_DATA_INIT(CConnect_to_Server)
	m_connectstatus = _T(&quot;&quot;);
	//}}AFX_DATA_INIT
	m_connect_progress.SetRange(0,100);
}	

void CConnect_to_Server::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CConnect_to_Server)
	DDX_Control(pDX, IDC_CONNECT_PROGRESS, m_connect_progress);
	DDX_Text(pDX, IDC_CONNECT_STATUS, m_connectstatus);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CConnect_to_Server, CDialog)
	//{{AFX_MSG_MAP(CConnect_to_Server)
	ON_WM_TIMER()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CConnect_to_Server message handlers

void CConnect_to_Server::OnCancel() 
{
	CDialog::OnCancel();
}

void CConnect_to_Server::OnTimer(UINT nIDEvent)   
{  
	KillTimer(nIDEvent);

	//Timer beendet, Anmeldung eingeleitet
	//Statusausgabe
	m_connectstatus = &quot;Verbindung wird hergestellt...&quot;;
	m_connect_progress.OffsetPos(20);
	UpdateData(false);

	//Socket-Datei wird entfernt
	remove(&quot;comm.sock&quot;);  

	//Setze Sanduhr...
	CWaitCursor WCursor;

	//Perl-Prozess wird eingeleitet

        //..............................................
        //....... Code, der eigentlich nix zur Sache tut

	//For testing purposes only
	m_kryptkey=&quot;12345678&quot;;

        //Connection to Server OK, LOGIN...
	MakeServerLogin dlgMakeServerLogin;
         dlgMakeServerLogin.DoModal();	

	CDialog::OnCancel();        
}

BOOL CConnect_to_Server::OnInitDialog() 
{	
	SetTimer(IDT_TIMER1, 20, NULL);

	CDialog::OnInitDialog();

	return TRUE;
}
</code></pre>
<p>Datei MakeServerLogin.h:</p>
<pre><code class="language-cpp">if !defined(AFX_MAKESERVERLOGIN_H__2767EF91_877D_4DC9_A6C9_D6540589F1AA__INCLUDED_)
#define AFX_MAKESERVERLOGIN_H__2767EF91_877D_4DC9_A6C9_D6540589F1AA__INCLUDED_

#if _MSC_VER &gt; 1000
#pragma once
#endif // _MSC_VER &gt; 1000
// MakeServerLogin.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// MakeServerLogin dialog

class MakeServerLogin : public CDialog
{
// Construction
public:
	MakeServerLogin(CWnd* pParent = NULL);   // standard constructor
// Dialog Data
	//{{AFX_DATA(MakeServerLogin)
	enum { IDD = IDD_MAKE_SERVER_LOGIN };
	CProgressCtrl	m_connect_progress;
	CString	m_connectstatus;
	CString	m_user;
	CString	m_pass;
	BOOL	m_save_login_data;
	//}}AFX_DATA

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(MakeServerLogin)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(MakeServerLogin)
	virtual BOOL OnInitDialog();
	afx_msg void OnTimer(UINT nIDEvent);
	virtual void OnOK();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_MAKESERVERLOGIN_H__2767EF91_877D_4DC9_A6C9_D6540589F1AA__INCLUDED_)
</code></pre>
<p>Datei MakeServerLogin.cpp:</p>
<pre><code class="language-cpp">// MakeServerLogin.cpp : implementation file
//

#include &quot;stdafx.h&quot;
#include &quot;SecMail.h&quot;
#include &quot;MakeServerLogin.h&quot;
#include &quot;Connect_to_Server.h&quot;
#include &quot;iostream.h&quot;
#include &quot;fstream.h&quot;

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

/////////////////////////////////////////////////////////////////////////////
// MakeServerLogin dialog

MakeServerLogin::MakeServerLogin(CWnd* pParent /*=NULL*/)
	: CDialog(MakeServerLogin::IDD, pParent)
{
	//{{AFX_DATA_INIT(MakeServerLogin)
	m_connectstatus = _T(&quot;&quot;);
	m_user = _T(&quot;&quot;);
	m_pass = _T(&quot;&quot;);
	m_save_login_data = TRUE;
	//}}AFX_DATA_INIT
	m_connect_progress.SetRange(0,100);
}

void MakeServerLogin::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(MakeServerLogin)
	DDX_Control(pDX, IDC_CONNECT_PROGRESS, m_connect_progress);
	DDX_Text(pDX, IDC_CONNECT_STATUS, m_connectstatus);
	DDX_Text(pDX, IDC_USERNAME, m_user);
	DDX_Text(pDX, IDC_PASSWORD, m_pass);
	DDX_Check(pDX, IDC_SAVE_LOGIN_DATA, m_save_login_data);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(MakeServerLogin, CDialog)
	//{{AFX_MSG_MAP(MakeServerLogin)
	ON_WM_TIMER()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// MakeServerLogin message handlers

BOOL MakeServerLogin::OnInitDialog() 
{
	SetTimer(IDT_TIMER1, 10, NULL);

	CDialog::OnInitDialog();

	return TRUE;
}

void MakeServerLogin::OnTimer(UINT nIDEvent) 
{
	KillTimer(nIDEvent);

	//.....................
	//Code, der eigentlich nix zur Sache tut.

	CConnect_to_Server connect; 
	MessageBox(connect.m_kryptkey); 

	CDialog::OnTimer(nIDEvent);
}

void MakeServerLogin::OnOK() 
{	
	//.....................
	//Code, der eigentlich nix zur Sache tut.

	CDialog::OnOK();
}
</code></pre>
<p>Also wenn ich mich nicht irre, wird das Dialogfeld aufgerufen oder?</p>
<p>mfg<br />
trequ</p>
]]></description><link>https://www.c-plusplus.net/forum/post/338964</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/338964</guid><dc:creator><![CDATA[trequ]]></dc:creator><pubDate>Sat, 23 Aug 2003 08:27:02 GMT</pubDate></item><item><title><![CDATA[Reply to Einsteiger-Frage: Probleme mit Variablen - Instanzierung on Sat, 23 Aug 2003 10:30:59 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">CConnect_to_Server connect;
if(connect.DoModal() == IDOK)
  MessageBox(connect.m_kryptkey);
</code></pre>
<p>DoModal zeigt das Dialogfeld modal an: Das heißt, dass das neue Dialogfeld aktiv ist und im alten Feld solange die Programmsteuerung gestoppt wird, bis das neue wieder verschwindet. Hat der user das neue Dialogfeld über OK verlassen (nicht über Abbrechen oder so), kommt die MessageBox.</p>
<p>Allgemein: Wenn du das zweite Dialogfeld durch OnOK(); verlässt, wird IDOK zurückgegeben, wenn du es durch OnCancel(); beendest, wird IDCANCEL zurückgegeben - so lässt sich vom ersten Dialogfeld aus prüfen, wie der Benutzer reagiert hat.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/339012</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/339012</guid><dc:creator><![CDATA[Phobos]]></dc:creator><pubDate>Sat, 23 Aug 2003 10:30:59 GMT</pubDate></item><item><title><![CDATA[Reply to Einsteiger-Frage: Probleme mit Variablen - Instanzierung on Sat, 23 Aug 2003 11:41:30 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>verstehe ich nicht so ganz.<br />
Das Problem ist folgendes:<br />
1. m_kryptkey hat einen Wert. (hab zum test 12345678 genommen)<br />
2. Das neue Dialogfeld wird aufgebaut.<br />
3. Jetzt will ich im neuen Dialogfeld den Wert von m_kryptkey haben, um ihn weiter zu verarbeiten. Im alten Dialogfeld hat er den Wert, in neuen ist er NULL.</p>
<p>Warum?</p>
<p>mfg<br />
trequ</p>
]]></description><link>https://www.c-plusplus.net/forum/post/339029</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/339029</guid><dc:creator><![CDATA[trequ]]></dc:creator><pubDate>Sat, 23 Aug 2003 11:41:30 GMT</pubDate></item></channel></rss>