home *** CD-ROM | disk | FTP | other *** search
- // LST14_01.CPP - Implementation file for your Internet Server
- // lst14_01 Extension
-
- #include <afx.h>
- #include <afxwin.h>
- #include <afxisapi.h>
- #include "resource.h"
- #include "lst14_01.h"
-
- ///////////////////////////////////////////////////////////////////////
- // command-parsing map
-
- BEGIN_PARSE_MAP(CLst14_01Extension, CHttpServer)
- // TODO: insert your ON_PARSE_COMMAND() and
- // ON_PARSE_COMMAND_PARAMS() here to hook up your commands.
- // For example:
-
- ON_PARSE_COMMAND(Default, CLst14_01Extension, ITS_EMPTY)
- ON_PARSE_COMMAND(Hello, CLst14_01Extension, ITS_EMPTY)
- ON_PARSE_COMMAND(GetName, CLst14_01Extension, ITS_PSTR)
- ON_PARSE_COMMAND_PARAMS("Name")
- DEFAULT_PARSE_COMMAND(Default, CLst14_01Extension)
- END_PARSE_MAP(CLst14_01Extension)
-
-
- ///////////////////////////////////////////////////////////////////////
- // The one and only CLst14_01Extension object
-
- CLst14_01Extension theExtension;
- CWinApp BugFix;
-
- ///////////////////////////////////////////////////////////////////////
- // CLst14_01Extension implementation
-
- CLst14_01Extension::CLst14_01Extension()
- {
- TRACE("Constructor\n");
- m_pnCounter = new UINT;
- (*m_pnCounter) = 0;
- }
-
- CLst14_01Extension::~CLst14_01Extension()
- {
- TRACE("Destructor\n");
- delete m_pnCounter;
- }
-
- BOOL CLst14_01Extension::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;
- }
-
- ///////////////////////////////////////////////////////////////////////
- // CLst14_01Extension command handlers
-
- void CLst14_01Extension::Default(CHttpServerContext* pCtxt)
- {
- StartContent(pCtxt);
- WriteTitle(pCtxt);
-
- *pCtxt << _T("This default message was produced by the Internet");
- *pCtxt << _T(" Server DLL Wizard. Edit your CLst14_01Extension::Default()");
- *pCtxt << _T(" implementation to change it.\r\n");
-
- EndContent(pCtxt);
- }
-
-
- void CLst14_01Extension::Hello(CHttpServerContext* pCtxt)
- {
- StartContent(pCtxt);
- WriteTitle(pCtxt);
-
- *pCtxt << _T("Hello World\r\n");
-
- EndContent(pCtxt);
- }
-
- void CLst14_01Extension::GetName(CHttpServerContext* pCtxt, LPCTSTR pName)
- {
- StartContent(pCtxt);
- WriteTitle(pCtxt);
-
- *pCtxt << _T("Name: ");
- *pCtxt << pName;
- *pCtxt << _T("<BR>\r\n");
-
- EndContent(pCtxt);
- }
-
- ///////////////////////////////////////////////////////////////////////
- // 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;
- }
-
- ****/
-