CInternetConnection::CInternetConnection
CInternetConnection( CInternetSession* pSession,
LPCTSTR pstrServer,
INTERNET_PORT nPort = INTERNET_INVALID_PORT_NUMBER,
DWORD dwContext = 1
);
参数:
pSession
指向CInternetSession对象的指针。
pstrServer
指向包含服务器名的字符串的指针。
nPort
标识此连接的Internet端口的数目。
dwContext
CInternetConnection对象的上下文标识符。请参阅说明部分,以了解有关dwContext的更多信息。
说明:
此成员函数在一个CInternetConnection对象被创建时调用。
不能自己调用CInternetConnection,而是根据要建立的连接类型调用CInternet-Session成员函数:
·CInternetSession::GetFtpConnection
·CInternetSession::GetHttpConnection
·CInternetSession::GetGopherConnection
dwContext的缺省值由MFC从创建InternetConnection派生对象的CInternetSession对象传送到CInternetConnection派生对象。缺省设置为1;但是,你可为连接明确指定一个CInternetSession构造函数中的上下文标识符。此对象及其所做工作将与上下文ID相关联。上下文标识符返回到CInternetSession::OnStatusCallback,以提供其所标志的对象状态。请参阅 “Visual C++程序员指南”中的“使用Internet初步:WinInet”,以了解有关上下文标识符的更多信息。
请参阅:
CInternetSession
,
CGopherConnection
,
CFtpConnection
,
CHttpConnection