CHttpServer::DeleteVirtualHost Method  
 
BOOL DeleteVirtualHost(
  UINT nHostId  
);

Delete a virtual host associated with the specified server.

Parameters

nHostId
An integer value which identifies the virtual host.

Return Value

If the method succeeds, the return value is non-zero. If the server handle is invalid or the virtual host ID does not specify a valid host, the method will return zero. If the method fails, the last error code will be updated to indicate the cause of the failure.

Remarks

The DeleteVirtualHost method removes a virtual host that was created by a previous call to the AddVirtualHost method. All virtual paths and users associated with the specified host are no longer valid. It is not necessary to call this method to delete any of the virtual hosts prior to stopping the server. Part of the normal shutdown process is releasing the resources allocated for each virtual host that was added to the server.

This method cannot be used to delete the virtual host with an ID of zero, which is the default virtual host that is allocated when the server is started.

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

See Also

AddVirtualHost, AddVirtualPath, AddVirtualUser DeleteVirtualPath, DeleteVirtualUser