<?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[Fehler in der Objekt Init, aus dem ich nicht schlau werde]]></title><description><![CDATA[<p>Guten Tag allerseits,</p>
<p>ich hoffe ich finde hier ein bißchen Hilfe.</p>
<p>Mein Problem sind folgende Fehler :<br />
test2dlg.h(54) : error C2146: syntax error : missing ';' before identifier 'm_sConnectSocket'<br />
test2dlg.h(54) : error C2501: 'CMySocket' : missing storage-class or type specifiers<br />
test2dlg.h(54) : error C2501: 'm_sConnectSocket' : missing storage-class or type specifiers<br />
test2dlg.h(55) : error C2146: syntax error : missing ';' before identifier 'm_sListenSocket'<br />
test2dlg.h(55) : error C2501: 'CMySocket' : missing storage-class or type specifiers<br />
test2dlg.h(55) : error C2501: 'm_sListenSocket' : missing storage-class or type specifiers</p>
<p>VC++ tut so als würde er die Klasse CMySocket nicht kennen. Ich habe wirklich keine Ahnung, wo der Fehler liegen kann.<br />
Sollten noch weitere Files benötigt werden, reiche ich die natürlich soschnell<br />
wie möglich nach.</p>
<p>Gruss,</p>
<p>Proteus</p>
<p>Anbei CMySocket.cpp und CTest2Dlg.h</p>
<p>Erstmal die File, wo der Error vorkommt</p>
<p><strong>CTest2Dlg.h</strong></p>
<pre><code class="language-cpp">// test2Dlg.h : header file
//

#if !defined(AFX_TEST2DLG_H__1B7B694F_270B_4B90_9E3A_C3C0D6EBAB7A__INCLUDED_)
#define AFX_TEST2DLG_H__1B7B694F_270B_4B90_9E3A_C3C0D6EBAB7A__INCLUDED_

#include &quot;MySocket.h&quot;   // Added by ClassView

#if _MSC_VER &gt; 1000
#pragma once
#endif // _MSC_VER &gt; 1000

/////////////////////////////////////////////////////////////////////////////
// CTest2Dlg dialog

class CTest2Dlg : public CDialog
{
// Construction
public:
    void OnReceive();
    void OnClose();
    void OnSend();
    void OnConnect();
    void OnAccept();
    int m_iPort;
    CTest2Dlg(CWnd* pParent = NULL);    // standard constructor

// Dialog Data
    //{{AFX_DATA(CTest2Dlg)
    enum { IDD = IDD_TEST2_DIALOG };
        // NOTE: the ClassWizard will add data members here
    //}}AFX_DATA

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

// Implementation
protected:
    HICON m_hIcon;

    // Generated message map functions
    //{{AFX_MSG(CTest2Dlg)
    virtual BOOL OnInitDialog();
    afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
    afx_msg void OnPaint();
    afx_msg HCURSOR OnQueryDragIcon();
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
private:
    CMySocket m_sConnectSocket;  // ERROR !!!
    CMySocket m_sListenSocket;  // ERROR !!!
};

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

#endif // !defined(AFX_TEST2DLG_H__1B7B694F_270B_4B90_9E3A_C3C0D6EBAB7A__INCLUDED_)
</code></pre>
<p><strong>CMySocket</strong></p>
<pre><code class="language-cpp">// MySocket.cpp : implementation file
//

#include &quot;stdafx.h&quot;
#include &quot;Test2.h&quot;
#include &quot;MySocket.h&quot;
#include &quot;Test2Dlg.h&quot;

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

/////////////////////////////////////////////////////////////////////////////
// CMySocket

CMySocket::CMySocket()

{

}

CMySocket::~CMySocket()
{
}

// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(CMySocket, CAsyncSocket)
    //{{AFX_MSG_MAP(CMySocket)
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif  // 0

/////////////////////////////////////////////////////////////////////////////
// CMySocket member functions

void CMySocket::SetParent(CDialog *pWnd)
{

    m_pWnd = pWnd;

}

void CMySocket::OnAccept(int nErrorCode)
{

   ((CTest2Dlg*)m_pWnd)-&gt;OnAccept();

}

void CMySocket::OnConnect(int nErrorCode)
{
   ((CTest2Dlg*)m_pWnd)-&gt;OnConnect();
}

void CMySocket::OnClose(int nErrorCode)
{
   ((CTest2Dlg*)m_pWnd)-&gt;OnClose();
}

void CMySocket::OnReceive(int nErrorCode)
{
   ((CTest2Dlg*)m_pWnd)-&gt;OnReceive(); 
}

void CMySocket::OnSend(int nErrorCode)
{
  ((CTest2Dlg*)m_pWnd)-&gt;OnSend(); 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/5702/fehler-in-der-objekt-init-aus-dem-ich-nicht-schlau-werde</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 06:37:30 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/5702.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 May 2003 11:36:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fehler in der Objekt Init, aus dem ich nicht schlau werde on Mon, 05 May 2003 11:36:00 GMT]]></title><description><![CDATA[<p>Guten Tag allerseits,</p>
<p>ich hoffe ich finde hier ein bißchen Hilfe.</p>
<p>Mein Problem sind folgende Fehler :<br />
test2dlg.h(54) : error C2146: syntax error : missing ';' before identifier 'm_sConnectSocket'<br />
test2dlg.h(54) : error C2501: 'CMySocket' : missing storage-class or type specifiers<br />
test2dlg.h(54) : error C2501: 'm_sConnectSocket' : missing storage-class or type specifiers<br />
test2dlg.h(55) : error C2146: syntax error : missing ';' before identifier 'm_sListenSocket'<br />
test2dlg.h(55) : error C2501: 'CMySocket' : missing storage-class or type specifiers<br />
test2dlg.h(55) : error C2501: 'm_sListenSocket' : missing storage-class or type specifiers</p>
<p>VC++ tut so als würde er die Klasse CMySocket nicht kennen. Ich habe wirklich keine Ahnung, wo der Fehler liegen kann.<br />
Sollten noch weitere Files benötigt werden, reiche ich die natürlich soschnell<br />
wie möglich nach.</p>
<p>Gruss,</p>
<p>Proteus</p>
<p>Anbei CMySocket.cpp und CTest2Dlg.h</p>
<p>Erstmal die File, wo der Error vorkommt</p>
<p><strong>CTest2Dlg.h</strong></p>
<pre><code class="language-cpp">// test2Dlg.h : header file
//

#if !defined(AFX_TEST2DLG_H__1B7B694F_270B_4B90_9E3A_C3C0D6EBAB7A__INCLUDED_)
#define AFX_TEST2DLG_H__1B7B694F_270B_4B90_9E3A_C3C0D6EBAB7A__INCLUDED_

#include &quot;MySocket.h&quot;   // Added by ClassView

#if _MSC_VER &gt; 1000
#pragma once
#endif // _MSC_VER &gt; 1000

/////////////////////////////////////////////////////////////////////////////
// CTest2Dlg dialog

class CTest2Dlg : public CDialog
{
// Construction
public:
    void OnReceive();
    void OnClose();
    void OnSend();
    void OnConnect();
    void OnAccept();
    int m_iPort;
    CTest2Dlg(CWnd* pParent = NULL);    // standard constructor

// Dialog Data
    //{{AFX_DATA(CTest2Dlg)
    enum { IDD = IDD_TEST2_DIALOG };
        // NOTE: the ClassWizard will add data members here
    //}}AFX_DATA

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

// Implementation
protected:
    HICON m_hIcon;

    // Generated message map functions
    //{{AFX_MSG(CTest2Dlg)
    virtual BOOL OnInitDialog();
    afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
    afx_msg void OnPaint();
    afx_msg HCURSOR OnQueryDragIcon();
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
private:
    CMySocket m_sConnectSocket;  // ERROR !!!
    CMySocket m_sListenSocket;  // ERROR !!!
};

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

#endif // !defined(AFX_TEST2DLG_H__1B7B694F_270B_4B90_9E3A_C3C0D6EBAB7A__INCLUDED_)
</code></pre>
<p><strong>CMySocket</strong></p>
<pre><code class="language-cpp">// MySocket.cpp : implementation file
//

#include &quot;stdafx.h&quot;
#include &quot;Test2.h&quot;
#include &quot;MySocket.h&quot;
#include &quot;Test2Dlg.h&quot;

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

/////////////////////////////////////////////////////////////////////////////
// CMySocket

CMySocket::CMySocket()

{

}

CMySocket::~CMySocket()
{
}

// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(CMySocket, CAsyncSocket)
    //{{AFX_MSG_MAP(CMySocket)
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif  // 0

/////////////////////////////////////////////////////////////////////////////
// CMySocket member functions

void CMySocket::SetParent(CDialog *pWnd)
{

    m_pWnd = pWnd;

}

void CMySocket::OnAccept(int nErrorCode)
{

   ((CTest2Dlg*)m_pWnd)-&gt;OnAccept();

}

void CMySocket::OnConnect(int nErrorCode)
{
   ((CTest2Dlg*)m_pWnd)-&gt;OnConnect();
}

void CMySocket::OnClose(int nErrorCode)
{
   ((CTest2Dlg*)m_pWnd)-&gt;OnClose();
}

void CMySocket::OnReceive(int nErrorCode)
{
   ((CTest2Dlg*)m_pWnd)-&gt;OnReceive(); 
}

void CMySocket::OnSend(int nErrorCode)
{
  ((CTest2Dlg*)m_pWnd)-&gt;OnSend(); 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/27728</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27728</guid><dc:creator><![CDATA[Proteus]]></dc:creator><pubDate>Mon, 05 May 2003 11:36:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in der Objekt Init, aus dem ich nicht schlau werde on Mon, 05 May 2003 12:41:00 GMT]]></title><description><![CDATA[<p>Wieso zeigst Du uns nicht 'mysocket.h' ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27729</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27729</guid><dc:creator><![CDATA[RenéG]]></dc:creator><pubDate>Mon, 05 May 2003 12:41:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in der Objekt Init, aus dem ich nicht schlau werde on Mon, 05 May 2003 13:33:00 GMT]]></title><description><![CDATA[<p>ja klar.. sorry <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="😉"
    /> .. sicher...</p>
<pre><code class="language-cpp">#if !defined(AFX_MYSOCKET_H__F5AA0330_99D7_4BF5_8700_535CA7AC11F2__INCLUDED_)
#define AFX_MYSOCKET_H__F5AA0330_99D7_4BF5_8700_535CA7AC11F2__INCLUDED_

#include &quot;test2Dlg.h&quot;   // Added by ClassView
#if _MSC_VER &gt; 1000
#pragma once
#endif // _MSC_VER &gt; 1000
// MySocket.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CMySocket command target

class CMySocket : public CAsyncSocket
{
// Attributes
public:

// Operations
public:
    CMySocket();
    virtual ~CMySocket();

// Overrides
public:
    void SetParent(CDialog* pWnd);
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CMySocket)
    //}}AFX_VIRTUAL

    // Generated message map functions
    //{{AFX_MSG(CMySocket)
        // NOTE - the ClassWizard will add and remove member functions here.
    //}}AFX_MSG

// Implementation
protected:
    virtual void OnSend(int nErrorCode);
    virtual void OnReceive(int nErrorCode);
    virtual void OnClose(int nErrorCode);
    virtual void OnConnect(int nErrorCode);
    virtual void OnAccept(int ErrorCode);
private:
    CDialog* m_pWnd;
};

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

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

#endif // !defined(AFX_MYSOCKET_H__F5AA0330_99D7_4BF5_8700_535CA7AC11F2__INCLUDED_)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/27730</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27730</guid><dc:creator><![CDATA[Proteus]]></dc:creator><pubDate>Mon, 05 May 2003 13:33:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in der Objekt Init, aus dem ich nicht schlau werde on Mon, 05 May 2003 14:07:00 GMT]]></title><description><![CDATA[<p>wieoft willst du die Dialogklasse includen ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27731</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27731</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Mon, 05 May 2003 14:07:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in der Objekt Init, aus dem ich nicht schlau werde on Mon, 05 May 2003 14:58:00 GMT]]></title><description><![CDATA[<p>hmmm.. ja.. eigentlich nur einmal *G*..<br />
denkst du das ist das problem ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27732</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27732</guid><dc:creator><![CDATA[Proteus]]></dc:creator><pubDate>Mon, 05 May 2003 14:58:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in der Objekt Init, aus dem ich nicht schlau werde on Tue, 06 May 2003 06:13:00 GMT]]></title><description><![CDATA[<p>Ja sicher, deswegen fragte ich ja nach der mysocket.h !!!</p>
<p>Sowas:</p>
<pre><code class="language-cpp">// mysocket.h
#include &quot;testdlg.h&quot;

// testdlg.h
#include &quot;mysocket.h&quot;
</code></pre>
<p>funzt nunmal nicht. Wie auch? Stellt es doch eine 'Endlosschleife' dar!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27733</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27733</guid><dc:creator><![CDATA[RenéG]]></dc:creator><pubDate>Tue, 06 May 2003 06:13:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in der Objekt Init, aus dem ich nicht schlau werde on Tue, 06 May 2003 15:33:00 GMT]]></title><description><![CDATA[<p>ja danke.. hätte nicht gedacht, dass VC++ son scheiss macht</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27734</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27734</guid><dc:creator><![CDATA[Proteus]]></dc:creator><pubDate>Tue, 06 May 2003 15:33:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in der Objekt Init, aus dem ich nicht schlau werde on Tue, 06 May 2003 16:06:00 GMT]]></title><description><![CDATA[<p>was kann vc++ dafür, wenn du nen fehler machst?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27735</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27735</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Tue, 06 May 2003 16:06:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in der Objekt Init, aus dem ich nicht schlau werde on Tue, 06 May 2003 18:19:00 GMT]]></title><description><![CDATA[<p>wenn du genau hinschaust, dann siehst du nen Kommentar // added by ClassView<br />
also doch nicht mein Fehler ..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27736</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27736</guid><dc:creator><![CDATA[Proteus]]></dc:creator><pubDate>Tue, 06 May 2003 18:19:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in der Objekt Init, aus dem ich nicht schlau werde on Wed, 07 May 2003 04:32:00 GMT]]></title><description><![CDATA[<p>Schon dein Fehler.<br />
Und zwar lücken im C++-Wissen.</p>
<p>Ein Header soll man nur einmal includen.<br />
Deshalb gibt es dieses<br />
#pragma once</p>
<p>bzw. oft verschiedene<br />
#ifdef<br />
#endif</p>
<p>Will man eine Klasse einer anderen bekannt machen benutzt man in deinem Fall ein forwarddeklaration</p>
<p>class Mysocket</p>
<p>und der include kommt in die cpp</p>
<p>Eine IDE kann dir nicht alle Arbeit abnehmen sonst könnte ja jeder Softwareentwickler werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27737</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27737</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Wed, 07 May 2003 04:32:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in der Objekt Init, aus dem ich nicht schlau werde on Wed, 07 May 2003 19:24:00 GMT]]></title><description><![CDATA[<p>manchmal habe ich wirklich das Gefühl jeder könnte das werden.</p>
<p>Gut, man kann immer etwas dazu lernen .. danke trotzdem</p>
]]></description><link>https://www.c-plusplus.net/forum/post/27738</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/27738</guid><dc:creator><![CDATA[Proteus]]></dc:creator><pubDate>Wed, 07 May 2003 19:24:00 GMT</pubDate></item></channel></rss>