www.pudn.com > HelloISAPIWorld.rar > HelloISAPIWorld.cpp


// HELLOISAPIWORLD.CPP - Implementation file for your Internet Server 
//    HelloISAPIWorld Extension 
 
#include "stdafx.h" 
#include "HelloISAPIWorld.h" 
 
/////////////////////////////////////////////////////////////////////// 
// 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; 
 
/////////////////////////////////////////////////////////////////////// 
// command-parsing map 
 
BEGIN_PARSE_MAP(CHelloISAPIWorldExtension, CHttpServer) 
	// TODO: insert your ON_PARSE_COMMAND() and  
	// ON_PARSE_COMMAND_PARAMS() here to hook up your commands. 
	// For example: 
 
	ON_PARSE_COMMAND(Default, CHelloISAPIWorldExtension, ITS_EMPTY) 
	DEFAULT_PARSE_COMMAND(Default, CHelloISAPIWorldExtension) 
END_PARSE_MAP(CHelloISAPIWorldExtension) 
 
 
/////////////////////////////////////////////////////////////////////// 
// The one and only CHelloISAPIWorldExtension object 
 
CHelloISAPIWorldExtension theExtension; 
 
 
/////////////////////////////////////////////////////////////////////// 
// CHelloISAPIWorldExtension implementation 
 
CHelloISAPIWorldExtension::CHelloISAPIWorldExtension() 
{ 
} 
 
CHelloISAPIWorldExtension::~CHelloISAPIWorldExtension() 
{ 
} 
 
BOOL CHelloISAPIWorldExtension::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 CHelloISAPIWorldExtension::TerminateExtension(DWORD dwFlags) 
{ 
	// extension is being terminated 
	//TODO: Clean up any per-instance resources 
	return TRUE; 
} 
 
/////////////////////////////////////////////////////////////////////// 
// CHelloISAPIWorldExtension command handlers 
 
void CHelloISAPIWorldExtension::Default(CHttpServerContext* pCtxt) 
{ 
	StartContent(pCtxt); 
	WriteTitle(pCtxt); 
 
	*pCtxt << _T("This default message was produced by the Internet"); 
	*pCtxt << _T(" Server DLL Wizard. Edit your CHelloISAPIWorldExtension::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(CHelloISAPIWorldExtension, CHttpServer) 
	//{{AFX_MSG_MAP(CHelloISAPIWorldExtension) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
#endif	// 0 
 
 
 
/////////////////////////////////////////////////////////////////////// 
// 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; 
} 
 
****/