This topic has not yet been rated - Rate this topic

Initializing Request Handlers 

To have initialization code executed before the request and response objects have been initialized

  • Add code to the constructor of your request handler.

    Use the constructor for initialization that cannot fail because there is no supported way of returning an error from the constructor of a request handler.

To have initialization code executed before the request object has been initialized and after the response object has been initialized

  • Override CRequestHandlerT::CheckValidRequest in your request handler.

    You can use the server context and response object, but do not use the request object. If the initialization code that you add to CheckValidRequest fails, you can return an HTTP status code.

To have initialization code executed after the request and response objects have been initialized

To uninitialize your request handler

  1. Override CRequestHandlerT::Uninitialize in your request handler and add your code there.

    –or–

  2. Add code to your request handler's destructor.

See Also

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.