Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Some1 help me with sockets!!

Status
Not open for further replies.

bnhshallow

Programmer
Dec 14, 2001
12
US
Ive had the VC++ Standard for 2 days now and im workin on these sockets. the compliler says that there are two errors in the following code...

void MySocket::SetParent(CDialog *pWnd)
{
m_pWnd = pWnd;
}

void MySocket::OnAccept(int nErrorCode)
{
if (nErrorCode == 0)
((CSockDlg *)m_pWnd)->OnAccept(); //This the one with the
//Errors
}

void MySocket::OnConnect(int nErrorCode)
{

}

void MySocket::OnClose(int nErrorCode)
{

}

void MySocket::OnReceive(int nErrorCode)
{

}



void MySocket::OnSend(int nErrorCode)
{

}


The Errors are:
error C2065: 'CSockDlg' : undeclared identifier
error C2059: syntax error : ')'
Also, the "OnClose" function (i think) is wrong because i forgot to check the "Virtual" Box when creating it. Is there anyway do completly delete a function like that??

 


((CSockDlg *)m_pWnd)->OnAccept();

The above code should look like this.

CSockDlg* pDlg = (CSockDlg*)m_pWnd;
pDlg->OnAccept();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top