Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Visual C++
Reference
Libraries Reference
MFC
Classes
Member Functions
 CInternetSession::GetHttpConnection

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
MFC Library Reference 
CInternetSession::GetHttpConnection 

Call this member function to establish an HTTP connection and get a pointer to a CHttpConnection object.

CHttpConnection* GetHttpConnection(
   LPCTSTR pstrServer,
   INTERNET_PORT nPort = INTERNET_INVALID_PORT_NUMBER,
   LPCTSTR pstrUserName = NULL,
   LPCTSTR pstrPassword = NULL 
);
CHttpConnection* GetHttpConnection(
   LPCTSTR pstrServer,
   DWORD dwFlags,
   INTERNET_PORT nPort = INTERNET_INVALID_PORT_NUMBER,
   LPCTSTR pstrUserName = NULL,
   LPCTSTR pstrPassword = NULL 
);

Parameters

pstrServer

A pointer to a string containing the HTTP server name.

nPort

A number that identifies the TCP/IP port to use on the server.

pstrUserName

A pointer to a string containing the user name.

pstrPassword

A pointer to a string containing the access password.

dwflags

Any combination of the INTERNET_ FLAG_* flags. See the table in the Remarks section of CHttpConnection::OpenRequest for a description of dwFlags values.

A pointer to a CHttpConnection object. If the call fails, determine the cause of the failure by examining the thrown CInternetException object.

GetHttpConnection connects to an HTTP server, and creates and returns a pointer to a CHttpConnection object. It does not perform any specific operation on the server. If you intend to query an HTTP header, for example, you must perform this operation as a separate step. See the classes CHttpConnection and CHttpFile for information about operations you can perform by using a connection to an HTTP server. For information about browsing an HTTP site, see the member function OpenURL. See the article Internet Programming with WinInet for steps in performing common HTTP connection tasks.

This method can throw exceptions of type CInternetException*.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker