InetConnect Example for C++ 5.0 and later
This is also the example for the EnableMethodErrors property.
void CNet::Method ()
{
int nRet;
CString cs,text;
m_pRasterInet->EnableMethodErrors
= FALSE;
/* get the name of the computer entered in the edit box
control */
m_Remote.GetWindowText(text);
/* Connect to remote computer on port 1000 */
BSTR bstrtext = text.AllocSysString();
nRet = m_pRasterInet->InetConnect(bstrtext,
1000);
SysFreeString(bstrtext);
if (nRet != 0)
{
cs.Format(TEXT(" %s\n %s\n",
"Error connecting to :"), text);
AfxMessageBox(cs);
}
}