Share via


IVMNetworkAdapter::AttachToVirtualNetwork method

The AttachToVirtualNetwork method attaches the virtual NIC to the specified virtual network.

Syntax

HRESULT AttachToVirtualNetwork(
  [in] IVMVirtualNetwork *virtualNetwork
);

Parameters

virtualNetwork [in]

The virtual network to which this virtual NIC will be connected.

Return value

This method can return one of these values.

Return code Description
S_OK
The operation was successful.
E_POINTER
The virtualNetwork parameter is NULL.
E_INVALIDARG
The virtualNetwork parameter does not contain a valid virtual network.
E_ACCESS_DENIED
Access was denied to the requested virtual network.
VM_E_VM_UNKNOWN
The virtual machine is invalid or no longer exists.
VM_E_INVALID_VIRTUAL_NETWORK_ID
The virtualNetwork parameter is not an existing virtual network.
DISP_E_EXCEPTION
An unexpected error has occurred.

Requirements

Product
Microsoft Virtual Server 2005 onWindows Server 2003
Download
Microsoft Virtual Server 2005 R2 SP1 Update onWindows Server 2008orWindows Server 2003
Header
VsComInterfaces.h

See also

IVMNetworkAdapter