CWebView::UnmapVirtualHost Method  
 
BOOL UnmapVirtualHost(
  LPCTSTR lpszHostName  
);

The UnmapVirtualHost function removes the mapping of a virtual host name to a folder path.

Parameters

lpszHostName
A null-terminated string which specifies the virtual host name whose mapping should be removed. This parameter cannot be NULL or an empty string.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call the GetLastError method.

Remarks

The UnmapVirtualHost function removes a virtual host mapping previously established using MapVirtualHost. After the mapping is removed, the browser can no longer use the virtual host name to load resources from the associated local directory. This does not delete or modify any files in the directory, nor does it affect other virtual host mappings.

Removing a mapping only affects the current CWebView instance. Other instances that have independently established a mapping for the same host name are not affected, even if they share the same browser environment or user data folder.

Removing a mapping does not automatically unload documents or resources that have already been loaded from the virtual host. However, subsequent requests for resources using that host name will no longer be resolved to the local directory. Applications should navigate to another document or reload the current document as appropriate after removing a mapping.

Virtual host mappings are automatically discarded when the class instance is destroyed, so it is not necessary to explicitly remove them before closing the browser.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: cshtmv12.lib

See Also