CHttpServer::OnExecute Method  
 
virtual void OnExecute(
  UINT nClientId,  
  LPCTSTR lpszCommand,  
  LPCTSTR lpszResource,  
  LPCTSTR lpszParameters,  
  DWORD dwExitCode  
);

A virtual method that is invoked after the client has successfully executed a CGI program or script on the server.

Parameters

nClientId
An unsigned integer which uniquely identifies the client session.
lpszCommand
A null-terminated string that specifies the command issued by the client. The command name will always be capitalized. For a complete list of commands supported by the server, see Server Commands.
lpszResource
A null-terminated string that specifies the resource that the client has requested.
lpszParameters
A null-terminated string that specifies any query parameters that have been provided by the client. The string will be empty if there were no query parameters included with the request. The query parameters in this string will be URL encoded.
dwExitCode
An unsigned integer that specifies the exit code that was returned by the program.

Return Value

None.

Remarks

The OnExecute event handler is invoked after the client has successfully executed an external CGI program or script. To implement an event handler, the application should create a class derived from the CHttpServer class, and then override this method.

External programs must be registered by the server application using the RegisterProgram method. To enable the use of scripts, the RegisterHandler method can be used to associate an executable program with a specific file extension.

The GetProgramOutput method can be used to obtain the unfiltered output from the external command, while the GetProgramText method will return filtered output from the program that contains only printable text characters.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools11.h
Import Library: cshtsv11.lib
Unicode: Implemented as Unicode and ANSI versions

See Also

GetProgramOutput, GetProgramText, RegisterHandler, RegisterProgram