home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / VC_4x_Wizard / cfxwiz.awx / TEMPLATE / REQUEST.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-08  |  1.1 KB  |  52 lines

  1. /////////////////////////////////////////////////////////////////////
  2. //
  3. // $$TAGNAME$$ - Cold Fusion custom tag
  4. //
  5. // Copyright $$YEAR$$. All Rights Reserved.
  6. //
  7.  
  8.  
  9. #include "stdafx.h"        // Standard MFC libraries
  10. #include "cfx.h"        // CFX Custom Tag API
  11.  
  12.  
  13. void ProcessTagRequest( CCFXRequest* pRequest ) 
  14. {
  15.     try
  16.     {
  17.         // Retrieve attributes passed to the tag        
  18.         // For example: 
  19.         //    LPCSTR lpszColor = pRequest->GetAttribute("COLOR") ;
  20.  
  21.         
  22.  
  23.         // Write output back to the user here...
  24.         pRequest->Write( "Hello from $$TAGNAME$$!" ) ;
  25.  
  26.  
  27.  
  28.         // Output optional debug info
  29.         if ( pRequest->Debug() )
  30.         {
  31.             pRequest->WriteDebug( "Debug info..." ) ;
  32.         }
  33.     }
  34.  
  35.     // Catch Cold Fusion exceptions & re-raise them
  36.     catch( CCFXException* e )
  37.     {
  38.         pRequest->ReThrowException( e ) ;
  39.     }
  40.     
  41.     // Catch ALL other exceptions and throw them as 
  42.     // Cold Fusion exceptions (DO NOT REMOVE! -- 
  43.     // this prevents the server from crashing in 
  44.     // case of an unexpected exception)
  45.     catch( ... )
  46.     {
  47.         pRequest->ThrowException( 
  48.             "Error occurred in tag $$TAGNAME$$",
  49.             "Unexpected error occurred while processing tag." ) ;
  50.     }
  51. }
  52.