?? afxisapi.h
字號(hào):
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1998 Microsoft Corporation
// All rights reserved.
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
#ifndef __AFXISAPI_H_
#define __AFXISAPI_H_
#ifdef _UNICODE
#error ERROR: ISAPI does not yet support Unicode.
#endif
/////////////////////////////////////////////////////////////////////////////
// Turn off warnings for /W4
// To resume any of these warning: #pragma warning(default: 4xxx)
// which should be placed after the AFX include files
#ifndef ALL_WARNINGS
// warnings generated with common MFC/Windows code
#pragma warning(disable: 4127) // constant expression for TRACE/ASSERT
#pragma warning(disable: 4134) // message map member fxn casts
#pragma warning(disable: 4201) // nameless unions are part of C++
#pragma warning(disable: 4511) // private copy constructors are good to have
#pragma warning(disable: 4512) // private operator= are good to have
#pragma warning(disable: 4514) // unreferenced inlines are common
#pragma warning(disable: 4710) // private constructors are disallowed
#pragma warning(disable: 4705) // statement has no effect in optimized code
#pragma warning(disable: 4191) // pointer-to-function casting
// warnings caused by normal optimizations
#ifndef _DEBUG
#pragma warning(disable: 4701) // local variable *may* be used without init
#pragma warning(disable: 4702) // unreachable code caused by optimizations
#pragma warning(disable: 4791) // loss of debugging info in retail version
#pragma warning(disable: 4189) // initialized but unused variable
#pragma warning(disable: 4390) // empty controlled statement
#endif
// warnings specific to _AFXDLL version
#ifdef _AFXDLL
#pragma warning(disable: 4204) // non-constant aggregate initializer
#endif
#ifdef _AFXDLL
#pragma warning(disable: 4275) // deriving exported class from non-exported
#pragma warning(disable: 4251) // using non-exported as public in exported
#endif
#endif //!ALL_WARNINGS
#define STRICT 1
#ifndef _DEBUG
#ifndef _AFX_ENABLE_INLINES
#define _AFX_ENABLE_INLINES
#endif
#endif
#include <httpext.h>
#include <httpfilt.h>
#ifndef _INC_STDLIB
#include <stdlib.h>
#endif
#ifndef _INC_TCHAR
#include <tchar.h>
#endif
#ifndef UNUSED
#ifdef _DEBUG
#define UNUSED(x)
#else
#define UNUSED(x) x
#endif
#endif
#define AFXISAPI __stdcall
#define AFXIS_DATADEF
#define AFXISAPI_CDECL __cdecl
#ifndef AFX_INLINE
#define AFX_INLINE __forceinline
#endif
#ifndef _countof
#define _countof(array) (sizeof(array)/sizeof(array[0]))
#endif
/////////////////////////////////////////////////////////////////////////////
// Internet Server API Library
#ifndef _AFX_NOFORCE_LIBS
#ifdef _AFXDLL
#ifdef _DEBUG
#ifdef _UNICODE
#pragma comment(lib, "MFCISUD.lib")
#else
#pragma comment(lib, "EAFXISD.lib")
#endif
#else
#ifdef _UNICODE
#pragma comment(lib, "MFCISU.lib")
#else
#pragma comment(lib, "EAFXIS.lib")
#endif // _UNICODE
#endif // _DEBUG
#else
#ifdef _DEBUG
#ifdef _UNICODE
#pragma comment(lib, "UAFXISD.lib")
#else
#pragma comment(lib, "NAFXISD.lib")
#endif
#else
#ifdef _UNICODE
#pragma comment(lib, "UAFXIS.lib")
#else
#pragma comment(lib, "NAFXIS.lib")
#endif // _UNICODE
#endif // _DEBUG
#endif // _AFXDLL
#pragma comment(lib, "kernel32.lib")
#pragma comment(lib, "user32.lib")
#pragma comment(lib, "winspool.lib")
#pragma comment(lib, "advapi32.lib")
#endif // _AFX_NOFORCE_LIBS
extern HINSTANCE AFXISAPI AfxGetResourceHandle();
/////////////////////////////////////////////////////////////////////////////
// AFXIASPI - MFC Internet Server API support
// Classes declared in this file
class CHtmlStream;
class CHttpServerContext;
class CHttpServer;
class CHttpFilterContext;
class CHttpFilter;
// Classes this file uses from elsewhere, sometimes
#ifdef _AFX
class CLongBinary;
class CByteArray;
#endif
///////////////////////////////////////////////////////////////////////
// CHtmlStream -- manages in-memory HTML
class CHtmlStream
{
public:
// Constructors
CHtmlStream(UINT nGrowBytes = 4096);
CHtmlStream(BYTE* lpBuffer, UINT nBufferSize, UINT nGrowBytes = 0);
// Operations
void Attach(BYTE* lpBuffer, UINT nBufferSize, UINT nGrowBytes = 0);
BYTE* Detach();
DWORD GetStreamSize() const;
virtual void Abort();
virtual void Close();
virtual void InitStream();
virtual void Reset();
virtual void Write(const void* lpBuf, UINT nCount);
CHtmlStream& operator<<(LPCTSTR psz);
CHtmlStream& operator<<(short int w);
CHtmlStream& operator<<(long int dw);
CHtmlStream& operator<<(const CHtmlStream& stream);
CHtmlStream& operator<<(double d);
CHtmlStream& operator<<(float f);
#ifdef _AFX
CHtmlStream& operator<<(const CByteArray& array);
CHtmlStream& operator<<(const CLongBinary& blob);
#endif
// Advanced Overridables
protected:
virtual BYTE* Alloc(DWORD nBytes);
virtual BYTE* Realloc(BYTE* lpMem, DWORD nBytes);
virtual BYTE* Memcpy(BYTE* lpMemTarget, const BYTE* lpMemSource, UINT nBytes);
virtual void GrowStream(DWORD dwNewLen);
DWORD m_nStreamSize;
public:
virtual void Free(BYTE* lpMem);
// Implementation
protected:
UINT m_nGrowBytes;
DWORD m_nPosition;
DWORD m_nBufferSize;
BYTE* m_lpBuffer;
BOOL m_bAutoDelete;
public:
virtual ~CHtmlStream();
};
///////////////////////////////////////////////////////////////////////
// Status codes for HTTP transactions
#ifndef _WININET_ // these symbols may come from WININET.H
#define HTTP_STATUS_OK 200 // OK
#define HTTP_STATUS_CREATED 201 // created
#define HTTP_STATUS_ACCEPTED 202 // accepted
#define HTTP_STATUS_NO_CONTENT 204 // no content
#define HTTP_STATUS_REDIRECT 301 // moved permanently
#define HTTP_STATUS_TEMP_REDIRECT 302 // moved temporarily
#define HTTP_STATUS_NOT_MODIFIED 304 // not modified
#define HTTP_STATUS_BAD_REQUEST 400 // bad request
#define HTTP_STATUS_AUTH_REQUIRED 401 // unauthorized
#define HTTP_STATUS_FORBIDDEN 403 // forbidden
#define HTTP_STATUS_NOT_FOUND 404 // not found
#define HTTP_STATUS_REQUEST_TOO_LARGE 413 // Request entity was too large
#define HTTP_STATUS_SERVER_ERROR 500 // internal server error
#define HTTP_STATUS_NOT_IMPLEMENTED 501 // not implemented
#define HTTP_STATUS_BAD_GATEWAY 502 // bad gateway
#define HTTP_STATUS_SERVICE_NA 503 // service unavailable
#endif
///////////////////////////////////////////////////////////////////////
// Parse Map macros
#ifndef AFX_PARSE_CALL
#define AFX_PARSE_CALL
#endif
typedef void (AFX_PARSE_CALL CHttpServer::*AFX_PISAPICMD)(CHttpServerContext* pCtxt);
struct AFX_PARSEMAP_ENTRY; // declared after CHttpServer, below
struct AFX_PARSEMAP
{
UINT (PASCAL* pfnGetNumMapEntries)();
#ifdef _AFXDLL
const AFX_PARSEMAP* (PASCAL* pfnGetBaseMap)();
#else
const AFX_PARSEMAP* pBaseMap;
#endif
const AFX_PARSEMAP_ENTRY* lpEntries;
~AFX_PARSEMAP();
};
struct AFX_PARSEMAP_ENTRY_PARAMS
{
int nParams; // number of parameters
int nRequired; // number of parameters without defaults
// all of these are arrays!
LPTSTR* ppszInfo; // pointers to name[2n], pointer to default[2n+1]
BYTE* ppszDefaults; // pointers to coerced default values
BYTE* ppszValues; // pointers to coerced actual values
~AFX_PARSEMAP_ENTRY_PARAMS();
};
#ifdef _AFXDLL
#define DECLARE_PARSE_MAP() \
private: \
static AFX_PARSEMAP_ENTRY _parseEntries[]; \
public: \
static const AFX_PARSEMAP parseMap; \
static const AFX_PARSEMAP* PASCAL _GetBaseParseMap(); \
static UINT PASCAL GetNumMapEntries(); \
virtual const AFX_PARSEMAP* GetParseMap() const; \
#else
#define DECLARE_PARSE_MAP() \
private: \
static AFX_PARSEMAP_ENTRY _parseEntries[]; \
public: \
static const AFX_PARSEMAP parseMap; \
static UINT PASCAL GetNumMapEntries(); \
virtual const AFX_PARSEMAP* GetParseMap() const; \
#endif // _AFXDLL
#ifdef _AFXDLL
#define BEGIN_PARSE_MAP(theClass, baseClass) \
const AFX_PARSEMAP* PASCAL theClass::_GetBaseParseMap() \
{ return &baseClass::parseMap; } \
typedef void (AFX_PARSE_CALL theClass::*theClass##CALL)(CHttpServerContext*); \
const AFX_PARSEMAP* theClass::GetParseMap() const \
{ return &theClass::parseMap; } \
AFXIS_DATADEF const AFX_PARSEMAP theClass::parseMap = \
{ &theClass::GetNumMapEntries, &theClass::_GetBaseParseMap, &theClass::_parseEntries[0] }; \
AFX_PARSEMAP_ENTRY theClass::_parseEntries[] = \
{ \
#else
#define BEGIN_PARSE_MAP(theClass, baseClass) \
typedef void (AFX_PARSE_CALL theClass::*theClass##CALL)(CHttpServerContext*); \
const AFX_PARSEMAP* theClass::GetParseMap() const \
{ return &theClass::parseMap; } \
AFXIS_DATADEF const AFX_PARSEMAP theClass::parseMap = \
{ &theClass::GetNumMapEntries, &baseClass::parseMap, &theClass::_parseEntries[0] }; \
AFX_PARSEMAP_ENTRY theClass::_parseEntries[] = \
{ \
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -