Hvad fuck skal man skrive i OnAccept ??
Har det her lige nu, men det vil stadig ikke spille? Jeg fatter seriøst BRIK!
SocketClass.h
#pragma once
#include "afxwin.h"
#include "afxsock.h"
class CMyServerSocket : public CSocket
{
public:
CMyServerSocket();
~CMyServerSocket();
virtual void OnAccept( int nErrorCode );
};
class CMyServersClientConn : public CAsyncSocket
{
public:
CMyServersClientConn();
~CMyServersClientConn();
virtual void OnReceive( int nErrorCode );
};
Og SocketClass.cpp
#include "stdafx.h"
#include "Resource.h"
#include "mainappDlg.h"
#include "MySocketClass.h"
void CMyServerSocket::OnAccept( int nErrorCode )
{
UINT port = 2049;
CString IP;
CMyServersClientConn Incoming;
Incoming.Create(port);
Incoming.Listen();
}
void CMyServersClientConn::OnReceive( int nErrorCode )
{
//TODO
}
Indlæg senest redigeret d. 26.10.2006 08:56 af Bruger #10702