Compartilhar via


CHttpFile::CHttpFile

This member function is called to construct a CHttpFile object.

CHttpFile( 
   HINTERNET hFile, 
   HINTERNET hSession, 
   LPCTSTR pstrObject, 
   LPCTSTR pstrServer, 
   LPCTSTR pstrVerb, 
   DWORD_PTR dwContext  
); 
CHttpFile( 
   HINTERNET hFile, 
   LPCTSTR pstrVerb, 
   LPCTSTR pstrObject, 
   CHttpConnection* pConnection  
);

Parameters

  • hFile
    A handle to an Internet file.

  • hSession
    A handle to an Internet session.

  • pstrObject
    A pointer to a string containing the CHttpFile object.

  • pstrServer
    A pointer to a string containing the name of the server.

  • pstrVerb
    A pointer to a string containing the method to be used when sending the request. Can be POST, HEAD, or GET.

  • dwContext
    The context identifier for the CHttpFile object. See Remarks for more information about this parameter.

  • pConnection
    A pointer to a CHttpConnection object.

Remarks

You never construct a CHttpFile object directly; rather call CInternetSession::OpenURL or CHttpConnection::OpenRequest instead.

The default value for dwContext is sent by MFC to the CHttpFile object from the CInternetSession object that created the CHttpFile object. When you call CInternetSession::OpenURL or CHttpConnection to construct a CHttpFile object, you can override the default to set the context identifier to a value of your choosing. The context identifier is returned to CInternetSession::OnStatusCallback to provide status on the object with which it is identified. See the article Internet First Steps: WinInet for more information about the context identifier.

Requirements

Header: afxinet.h

See Also

Reference

CHttpFile Class

Hierarchy Chart

CInternetFile Class