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 >
C/C++ Source or Header  |  1998-06-18  |  6KB  |  244 lines

  1. $$IF(GenFilter)
  2. $$IF(GenExtension)
  3. // $$ROOT$$.CPP - Implementation file for your Internet Server
  4. //    $$FilterDesc$$ and $$ExtensionDesc$$
  5. $$ELSE
  6. // $$ROOT$$.CPP - Implementation file for your Internet Server
  7. //    $$FilterDesc$$
  8. $$ENDIF
  9. $$ELSE
  10. // $$ROOT$$.CPP - Implementation file for your Internet Server
  11. //    $$ExtensionDesc$$
  12. $$ENDIF
  13.  
  14. #include "stdafx.h"
  15. #include "$$root$$.h"
  16.  
  17. $$IF(UseMFCDLL)
  18. ///////////////////////////////////////////////////////////////////////
  19. // The one and only CWinApp object
  20. // NOTE: You may remove this object if you alter your project to no
  21. // longer use MFC in a DLL.
  22.  
  23. CWinApp theApp;
  24. $$ENDIF
  25.  
  26. $$IF(GenExtension)
  27. ///////////////////////////////////////////////////////////////////////
  28. // command-parsing map
  29.  
  30. BEGIN_PARSE_MAP($$ExtensionClass$$, CHttpServer)
  31.     // TODO: insert your ON_PARSE_COMMAND() and 
  32.     // ON_PARSE_COMMAND_PARAMS() here to hook up your commands.
  33.     // For example:
  34.  
  35.     ON_PARSE_COMMAND(Default, $$ExtensionClass$$, ITS_EMPTY)
  36.     DEFAULT_PARSE_COMMAND(Default, $$ExtensionClass$$)
  37. END_PARSE_MAP($$ExtensionClass$$)
  38.  
  39.  
  40. ///////////////////////////////////////////////////////////////////////
  41. // The one and only $$ExtensionClass$$ object
  42.  
  43. $$ExtensionClass$$ theExtension;
  44.  
  45.  
  46. ///////////////////////////////////////////////////////////////////////
  47. // $$ExtensionClass$$ implementation
  48.  
  49. $$ExtensionClass$$::$$ExtensionClass$$()
  50. {
  51. }
  52.  
  53. $$ExtensionClass$$::~$$ExtensionClass$$()
  54. {
  55. }
  56.  
  57. BOOL $$ExtensionClass$$::GetExtensionVersion(HSE_VERSION_INFO* pVer)
  58. {
  59.     // Call default implementation for initialization
  60.     CHttpServer::GetExtensionVersion(pVer);
  61.  
  62.     // Load description string
  63.     TCHAR sz[HSE_MAX_EXT_DLL_NAME_LEN+1];
  64.     ISAPIVERIFY(::LoadString(AfxGetResourceHandle(),
  65.             IDS_SERVER, sz, HSE_MAX_EXT_DLL_NAME_LEN));
  66.     _tcscpy(pVer->lpszExtensionDesc, sz);
  67.     return TRUE;
  68. }
  69.  
  70. BOOL $$ExtensionClass$$::TerminateExtension(DWORD dwFlags)
  71. {
  72.     // extension is being terminated
  73.     //TODO: Clean up any per-instance resources
  74.     return TRUE;
  75. }
  76.  
  77. ///////////////////////////////////////////////////////////////////////
  78. // $$ExtensionClass$$ command handlers
  79.  
  80. void $$ExtensionClass$$::Default(CHttpServerContext* pCtxt)
  81. {
  82.     StartContent(pCtxt);
  83.     WriteTitle(pCtxt);
  84.  
  85.     *pCtxt << _T("This default message was produced by the Internet");
  86.     *pCtxt << _T(" Server DLL Wizard. Edit your $$ExtensionClass$$::Default()");
  87.     *pCtxt << _T(" implementation to change it.\r\n");
  88.  
  89.     EndContent(pCtxt);
  90. }
  91.  
  92. // Do not edit the following lines, which are needed by ClassWizard.
  93. #if 0
  94. BEGIN_MESSAGE_MAP($$ExtensionClass$$, CHttpServer)
  95.     //{{AFX_MSG_MAP($$ExtensionClass$$)
  96.     //}}AFX_MSG_MAP
  97. END_MESSAGE_MAP()
  98. #endif    // 0
  99. $$ENDIF
  100.  
  101.  
  102. $$IF(GenFilter)
  103. ///////////////////////////////////////////////////////////////////////
  104. // The one and only $$FilterClass$$ object
  105.  
  106. $$FilterClass$$ theFilter;
  107.  
  108.  
  109. ///////////////////////////////////////////////////////////////////////
  110. // $$FilterClass$$ implementation
  111.  
  112. $$FilterClass$$::$$FilterClass$$()
  113. {
  114. }
  115.  
  116. $$FilterClass$$::~$$FilterClass$$()
  117. {
  118. }
  119.  
  120. BOOL $$FilterClass$$::GetFilterVersion(PHTTP_FILTER_VERSION pVer)
  121. {
  122.     // Call default implementation for initialization
  123.     CHttpFilter::GetFilterVersion(pVer);
  124.  
  125.     // Clear the flags set by base class
  126.     pVer->dwFlags &= ~SF_NOTIFY_ORDER_MASK;
  127.  
  128.     // Set the flags we are interested in
  129.     pVer->dwFlags |= $$FilterFlags$$;
  130.  
  131.     // Load description string
  132.     TCHAR sz[SF_MAX_FILTER_DESC_LEN+1];
  133.     ISAPIVERIFY(::LoadString(AfxGetResourceHandle(),
  134.             IDS_FILTER, sz, SF_MAX_FILTER_DESC_LEN));
  135.     _tcscpy(pVer->lpszFilterDesc, sz);
  136.     return TRUE;
  137. }
  138. $$IF(NotifyPreproc)
  139.  
  140. DWORD $$FilterClass$$::OnPreprocHeaders(CHttpFilterContext* pCtxt,
  141.     PHTTP_FILTER_PREPROC_HEADERS pHeaderInfo)
  142. {
  143.     // TODO: React to this notification accordingly and
  144.     // return the appropriate status code
  145.     return SF_STATUS_REQ_NEXT_NOTIFICATION;
  146. }
  147. $$ENDIF
  148. $$IF(NotifyAuthenticate)
  149.  
  150. DWORD $$FilterClass$$::OnAuthentication(CHttpFilterContext* pCtxt,
  151.     PHTTP_FILTER_AUTHENT pAuthent)
  152. {
  153.     // TODO: React to this notification accordingly and
  154.     // return the appropriate status code
  155.     return SF_STATUS_REQ_NEXT_NOTIFICATION;
  156. }
  157. $$ENDIF
  158. $$IF(NotifyURLMap)
  159.  
  160. DWORD $$FilterClass$$::OnUrlMap(CHttpFilterContext* pCtxt,
  161.     PHTTP_FILTER_URL_MAP pMapInfo)
  162. {
  163.     // TODO: React to this notification accordingly and
  164.     // return the appropriate status code
  165.     return SF_STATUS_REQ_NEXT_NOTIFICATION;
  166. }
  167. $$ENDIF
  168. $$IF(NotifySendRaw)
  169.  
  170. DWORD $$FilterClass$$::OnSendRawData(CHttpFilterContext* pCtxt,
  171.     PHTTP_FILTER_RAW_DATA pRawData)
  172. {
  173.     // TODO: React to this notification accordingly and
  174.     // return the appropriate status code
  175.     return SF_STATUS_REQ_NEXT_NOTIFICATION;
  176. }
  177. $$ENDIF
  178. $$IF(NotifyReadRaw)
  179.  
  180. DWORD $$FilterClass$$::OnReadRawData(CHttpFilterContext* pCtxt,
  181.     PHTTP_FILTER_RAW_DATA pRawData)
  182. {
  183.     // TODO: React to this notification accordingly and
  184.     // return the appropriate status code
  185.     return SF_STATUS_REQ_NEXT_NOTIFICATION;
  186. }
  187. $$ENDIF
  188. $$IF(NotifyLog)
  189.  
  190. DWORD $$FilterClass$$::OnLog(CHttpFilterContext *pCtxt, PHTTP_FILTER_LOG pLog)
  191. {
  192.     // TODO: React to this notification accordingly and
  193.     // return the appropriate status code
  194.     return SF_STATUS_REQ_NEXT_NOTIFICATION;
  195. }
  196. $$ENDIF
  197. $$IF(NotifyEnd)
  198.  
  199. DWORD $$FilterClass$$::OnEndOfNetSession(CHttpFilterContext* pCtxt)
  200. {
  201.     // TODO: React to this notification accordingly and
  202.     // return the appropriate status code
  203.     return SF_STATUS_REQ_NEXT_NOTIFICATION;
  204. }
  205. $$ENDIF
  206.  
  207. // Do not edit the following lines, which are needed by ClassWizard.
  208. #if 0
  209. BEGIN_MESSAGE_MAP($$FilterClass$$, CHttpFilter)
  210.     //{{AFX_MSG_MAP($$FilterClass$$)
  211.     //}}AFX_MSG_MAP
  212. END_MESSAGE_MAP()
  213. #endif    // 0
  214. $$ENDIF
  215.  
  216. ///////////////////////////////////////////////////////////////////////
  217. // If your extension will not use MFC, you'll need this code to make
  218. // sure the extension objects can find the resource handle for the
  219. // module.  If you convert your extension to not be dependent on MFC,
  220. // remove the comments arounn the following AfxGetResourceHandle()
  221. // and DllMain() functions, as well as the g_hInstance global.
  222.  
  223. /****
  224.  
  225. static HINSTANCE g_hInstance;
  226.  
  227. HINSTANCE AFXISAPI AfxGetResourceHandle()
  228. {
  229.     return g_hInstance;
  230. }
  231.  
  232. BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ulReason,
  233.                     LPVOID lpReserved)
  234. {
  235.     if (ulReason == DLL_PROCESS_ATTACH)
  236.     {
  237.         g_hInstance = hInst;
  238.     }
  239.  
  240.     return TRUE;
  241. }
  242.  
  243. ****/
  244.