Figure 1 New MFC Internet Server API Classes
Class Name | Description |
CHttpServer | Basis for DLL-based Internet server extensions |
CHttpFilter | Creates an Internet server message |
CHttpServerContext | Cooperates with CHttpServer to handle concurrent, multiple client requests |
CHttpFilterContext | Cooperates with CHttpFilter to handle concurrent, multiple client requests |
CHtmlStream | Models an HTML stream file |
Figure 2 WWWQUOTE Parse Map
CWWWQuote theExtension;
BEGIN_PARSE_MAP(CWWWQuote, CHttpServer)
DEFAULT_PARSE_COMMAND(Quote, CWWWQuote)
ON_PARSE_COMMAND(Quote, CWWWQuote, ITS_EMPTY)
ON_PARSE_COMMAND(Issues, CWWWQuote, ITS_PSTR)
ON_PARSE_COMMAND_PARAMS("Method")
ON_PARSE_COMMAND(GetQuotes, CWWWQuote, ITS_PSTR ITS_I4,
ITS_I4 ITS_I4 ITS_I4 ITS_I4 ITS_I4)
ON_PARSE_COMMAND_PARAMS("Ticker=~ Month=0 Year=0 MinMonth=0 MinYear=0 "
"MaxMonth=0 MaxYear=0")
ON_PARSE_COMMAND(PreviousMonth, CWWWQuote,
ITS_PSTR ITS_I4 ITS_I4 ITS_I4 ITS_I4 ITS_I4 ITS_I4)
ON_PARSE_COMMAND_PARAMS("Ticker Month Year MinMonth MinYear "
"MaxMonth MaxYear")
ON_PARSE_COMMAND(NextMonth, CWWWQuote,
ITS_PSTR ITS_I4 ITS_I4 ITS_I4 ITS_I4 ITS_I4 ITS_I4)
ON_PARSE_COMMAND_PARAMS("Ticker Month Year MinMonth MinYear MaxMonth MaxYear")
END_PARSE_MAP(CWWWQuote)
Figure 3 Extension Control Block
typedef struct _EXTENSION_CONTROL_BLOCK {
DWORD cbSize; //IN
DWORD dwVersion //IN
HCONN ConnID; //IN
DWORD dwHttpStatusCode; //OUT
CHAR lpszLogData[HSE_LOG_BUFFER_LEN]; //OUT
LPSTR lpszMethod; //IN
LPSTR lpszQueryString; //IN
LPSTR lpszPathInfo; //IN
LPSTR lpszPathTranslated; //IN
DWORD cbTotalBytes; //IN
DWORD cbAvailable; //IN
LPBYTE lpbData; //IN
LPSTR lpszContentType; //IN
BOOL ( WINAPI * GetServerVariable )
( HCONN hConn,
LPSTR lpszVariableName,
LPVOID lpvBuffer,
LPDWORD lpdwSize );
BOOL ( WINAPI * WriteClient )
( HCONN ConnID,
LPVOID Buffer,
LPDWORD lpdwBytes,
DWORD dwReserved );
BOOL ( WINAPI * ReadClient )
( HCONN ConnID,
LPVOID lpvBuffer,
LPDWORD lpdwSize );
BOOL ( WINAPI * ServerSupportFunction )
( HCONN hConn,
DWORD dwHSERRequest,
LPVOID lpvBuffer,
LPDWORD lpdwSize,
LPDWORD lpdwDataType );
}
Figure 4 WinInet Classes
Class Name | Description |
CInternetSession | Creates and initializes one or more Internet sessions, describing the connection to a proxy server if necessary. |
CInternetConnection | Manages the connection to a server. It's the base class for CFtpConnection, CHttpConnection, and CGopherConnection. |
CFtpConnection | Manages a connection to a server using FTP and supports direct manipulation of directories and files on the FTP server side of the connection. |
CGopherConnection | Manages a connection to a Gopher server. The class contains a constructor and three additional member functions: OpenFile, CreateLocator, and GetAttribute. |
CHttpConnection | Manages an HTTP connection. Contains a constructor and the member function OpenRequest. |
CInternetFile | The base class for the CHttpFile and CGopherFile file classes. Allows access to files on remote systems that use Internet protocols. |
CHttpFile | Finds and read files on an HTTP server. |
CGopherFile | Finds and reads files on a Gopher server. The Gopher service supported by this class is read-only. |
CFileFind | Performs local and Internet file searches and is the base class for CGopherFileFind and CFtpFileFind. |
CGopherFileFind | Searches Gopher servers. |
CFtpFileFind | Searches FTP servers. |
CInternetException | Encapsulates an Internet-related exception condition. |
AfxParseURL | Parses URLs of the form <service>://server/dir/dir/object.ext:<port> |
AfxGetInternetHandleType | Determines the type of an Internet handle. |