NetConnect Example for C++ 6.0 and later
void CDicomNetSink::OnNetConnect (long hNet, short nStatus)
{
CString cStr;
CString strTemp;
cStr.Format("*** NetConnect Event ***\nhNet[%x]\tnStatus[%d]\n", hNet, nStatus);
BSTR bstr = m_pDlg->m_pLEADDicomNet->GetPeerAddress (hNet);
CString strPeerAddress = bstr;
SysFreeString(bstr);
long lPeerPort = m_pDlg->m_pLEADDicomNet->GetPeerPort (hNet);
strTemp.Format("PeerAddress[%s]\nPeerPort[%d]\n", strPeerAddress, lPeerPort);
cStr = cStr + strTemp;
AfxMessageBox(cStr);
}