IVMVirtualServer::RegisterVirtualNetwork method
The RegisterVirtualNetwork method registers an existing virtual network configuration and returns the virtual network object.
Syntax
HRESULT RegisterVirtualNetwork(
[in] BSTR virtualNetworkName,
[in] BSTR virtualNetworkPath,
[out] IVMVirtualNetwork **virtualNetwork
);
Parameters
-
virtualNetworkName [in]
-
The name of the virtual network to register. The length of the name cannot exceed 256 characters and the combined length of the name and path cannot exceed 260 characters. The specified name may contain the .vnc file extension. If this parameter is NULL or an empty string, the virtualNetworkPath parameter must specify the full path to the configuration file.
-
virtualNetworkPath [in]
-
The path to the folder that contains the existing configuration file. If the virtualNetworkName parameter is NULL or an empty string, this must specify the full path to the existing configuration file.
-
virtualNetwork [out]
-
A pointer to a new IVMVirtualNetwork object which represents this virtual network.
Return value
This method supports standard return values, as well as the following. For information on Virtual Server specific return values not listed below, see HRESULT Codes Specific to the Virtual Server.
Return code | Description |
---|---|
|
The operation was successful. |
|
The virtualNetwork parameter is NULL. |
|
The virtualNetworkName or virtualNetworkPath parameter is not valid or is an empty string. |
|
The system cannot find the path specified by the virtualNetworkName and virtualNetworkPath parameters. |
|
The system cannot find the file specified by the virtualNetworkName and virtualNetworkPath parameters. |
|
virtualNetworkPath contains an invalid character (one of "*?:<>/|""). |
|
The parameter virtualNetworkPath parameter specifies an empty or relative path. An absolute path is required. |
|
The path specified by the virtualNetworkName and virtualNetworkPath parameters results in a path that is too long. The combined length of the path must be less than 260 characters. |
|
virtualNetworkName contains an invalid character (one of "*?:<>/|\""). |
|
There is already a virtual network with this name. |
|
An unexpected error has occurred. |
Remarks
The name must be unique with respect to the names of any existing virtual networks. Virtual network names are case-insensitive, for example, "MyNetwork" and "mynetwork" refer to the same virtual network.
Requirements
Product |
Microsoft Virtual Server 2005 onWindows Server 2003 |
Download |
Microsoft Virtual Server 2005 R2 SP1 Update onWindows Server 2008orWindows Server 2003 |
Header |
|