当 CInternetConnection 对象之后,该成员函数的调用。
CInternetConnection(
CInternetSession* pSession,
LPCTSTR pstrServer,
INTERNET_PORT nPort = INTERNET_INVALID_PORT_NUMBER,
DWORD_PTR dwContext = 1
);
参数
pSession
为 CInternetSession 对象的指针。pstrServer
对包含服务器名称的字符串的指针。nPort
标识此连接的Internet的端口号。dwContext
CInternetConnection 对象的上下文标识符。请参见 Remarks 有关 dwContext的更多信息。
备注
绝不调用 CInternetConnection ;相反,请调用要生成的连接类型的 CInternetSession 成员函数:
MFC发送 dwContext 的默认值设置为 CInternetConnection-从创建 InternetConnection-的 CInternetSession 对象的派生对象派生的对象。该默认设置为1;但是,可以为连接显式分配在 CInternetSession 构造函数的特定上下文标识符。它的对象及其所有工作要与该上下文ID.上下文标识符在它标识的对象返回到 CInternetSession::OnStatusCallback 提供状态。参见中的文章 Internet第一步:WinInet 有关上下文标识符的更多信息。
要求
Header: afxinet.h