home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
distrib.akp.su/Programming/Vb-6+Rus/
/
distrib.akp.su.tar
/
distrib.akp.su
/
Programming
/
Vb-6+Rus
/
COMMON
/
MSDEV98
/
BIN
/
IDE
/
INETAWZ.AWX
/
TEMPLATE
/
MAIN.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1998-06-18
|
6KB
|
244 lines
$$IF(GenFilter)
$$IF(GenExtension)
// $$ROOT$$.CPP - Implementation file for your Internet Server
// $$FilterDesc$$ and $$ExtensionDesc$$
$$ELSE
// $$ROOT$$.CPP - Implementation file for your Internet Server
// $$FilterDesc$$
$$ENDIF
$$ELSE
// $$ROOT$$.CPP - Implementation file for your Internet Server
// $$ExtensionDesc$$
$$ENDIF
#include "stdafx.h"
#include "$$root$$.h"
$$IF(UseMFCDLL)
///////////////////////////////////////////////////////////////////////
// The one and only CWinApp object
// NOTE: You may remove this object if you alter your project to no
// longer use MFC in a DLL.
CWinApp theApp;
$$ENDIF
$$IF(GenExtension)
///////////////////////////////////////////////////////////////////////
// command-parsing map
BEGIN_PARSE_MAP($$ExtensionClass$$, CHttpServer)
// TODO: insert your ON_PARSE_COMMAND() and
// ON_PARSE_COMMAND_PARAMS() here to hook up your commands.
// For example:
ON_PARSE_COMMAND(Default, $$ExtensionClass$$, ITS_EMPTY)
DEFAULT_PARSE_COMMAND(Default, $$ExtensionClass$$)
END_PARSE_MAP($$ExtensionClass$$)
///////////////////////////////////////////////////////////////////////
// The one and only $$ExtensionClass$$ object
$$ExtensionClass$$ theExtension;
///////////////////////////////////////////////////////////////////////
// $$ExtensionClass$$ implementation
$$ExtensionClass$$::$$ExtensionClass$$()
{
}
$$ExtensionClass$$::~$$ExtensionClass$$()
{
}
BOOL $$ExtensionClass$$::GetExtensionVersion(HSE_VERSION_INFO* pVer)
{
// Call default implementation for initialization
CHttpServer::GetExtensionVersion(pVer);
// Load description string
TCHAR sz[HSE_MAX_EXT_DLL_NAME_LEN+1];
ISAPIVERIFY(::LoadString(AfxGetResourceHandle(),
IDS_SERVER, sz, HSE_MAX_EXT_DLL_NAME_LEN));
_tcscpy(pVer->lpszExtensionDesc, sz);
return TRUE;
}
BOOL $$ExtensionClass$$::TerminateExtension(DWORD dwFlags)
{
// extension is being terminated
//TODO: Clean up any per-instance resources
return TRUE;
}
///////////////////////////////////////////////////////////////////////
// $$ExtensionClass$$ command handlers
void $$ExtensionClass$$::Default(CHttpServerContext* pCtxt)
{
StartContent(pCtxt);
WriteTitle(pCtxt);
*pCtxt << _T("This default message was produced by the Internet");
*pCtxt << _T(" Server DLL Wizard. Edit your $$ExtensionClass$$::Default()");
*pCtxt << _T(" implementation to change it.\r\n");
EndContent(pCtxt);
}
// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP($$ExtensionClass$$, CHttpServer)
//{{AFX_MSG_MAP($$ExtensionClass$$)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif // 0
$$ENDIF
$$IF(GenFilter)
///////////////////////////////////////////////////////////////////////
// The one and only $$FilterClass$$ object
$$FilterClass$$ theFilter;
///////////////////////////////////////////////////////////////////////
// $$FilterClass$$ implementation
$$FilterClass$$::$$FilterClass$$()
{
}
$$FilterClass$$::~$$FilterClass$$()
{
}
BOOL $$FilterClass$$::GetFilterVersion(PHTTP_FILTER_VERSION pVer)
{
// Call default implementation for initialization
CHttpFilter::GetFilterVersion(pVer);
// Clear the flags set by base class
pVer->dwFlags &= ~SF_NOTIFY_ORDER_MASK;
// Set the flags we are interested in
pVer->dwFlags |= $$FilterFlags$$;
// Load description string
TCHAR sz[SF_MAX_FILTER_DESC_LEN+1];
ISAPIVERIFY(::LoadString(AfxGetResourceHandle(),
IDS_FILTER, sz, SF_MAX_FILTER_DESC_LEN));
_tcscpy(pVer->lpszFilterDesc, sz);
return TRUE;
}
$$IF(NotifyPreproc)
DWORD $$FilterClass$$::OnPreprocHeaders(CHttpFilterContext* pCtxt,
PHTTP_FILTER_PREPROC_HEADERS pHeaderInfo)
{
// TODO: React to this notification accordingly and
// return the appropriate status code
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
$$ENDIF
$$IF(NotifyAuthenticate)
DWORD $$FilterClass$$::OnAuthentication(CHttpFilterContext* pCtxt,
PHTTP_FILTER_AUTHENT pAuthent)
{
// TODO: React to this notification accordingly and
// return the appropriate status code
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
$$ENDIF
$$IF(NotifyURLMap)
DWORD $$FilterClass$$::OnUrlMap(CHttpFilterContext* pCtxt,
PHTTP_FILTER_URL_MAP pMapInfo)
{
// TODO: React to this notification accordingly and
// return the appropriate status code
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
$$ENDIF
$$IF(NotifySendRaw)
DWORD $$FilterClass$$::OnSendRawData(CHttpFilterContext* pCtxt,
PHTTP_FILTER_RAW_DATA pRawData)
{
// TODO: React to this notification accordingly and
// return the appropriate status code
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
$$ENDIF
$$IF(NotifyReadRaw)
DWORD $$FilterClass$$::OnReadRawData(CHttpFilterContext* pCtxt,
PHTTP_FILTER_RAW_DATA pRawData)
{
// TODO: React to this notification accordingly and
// return the appropriate status code
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
$$ENDIF
$$IF(NotifyLog)
DWORD $$FilterClass$$::OnLog(CHttpFilterContext *pCtxt, PHTTP_FILTER_LOG pLog)
{
// TODO: React to this notification accordingly and
// return the appropriate status code
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
$$ENDIF
$$IF(NotifyEnd)
DWORD $$FilterClass$$::OnEndOfNetSession(CHttpFilterContext* pCtxt)
{
// TODO: React to this notification accordingly and
// return the appropriate status code
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
$$ENDIF
// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP($$FilterClass$$, CHttpFilter)
//{{AFX_MSG_MAP($$FilterClass$$)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif // 0
$$ENDIF
///////////////////////////////////////////////////////////////////////
// If your extension will not use MFC, you'll need this code to make
// sure the extension objects can find the resource handle for the
// module. If you convert your extension to not be dependent on MFC,
// remove the comments arounn the following AfxGetResourceHandle()
// and DllMain() functions, as well as the g_hInstance global.
/****
static HINSTANCE g_hInstance;
HINSTANCE AFXISAPI AfxGetResourceHandle()
{
return g_hInstance;
}
BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ulReason,
LPVOID lpReserved)
{
if (ulReason == DLL_PROCESS_ATTACH)
{
g_hInstance = hInst;
}
return TRUE;
}
****/