IVMSerialPort::Configure method
[Windows Virtual PC is no longer available for use as of Windows 8. Instead, use the Hyper-V WMI provider (V2).]
Configures the serial port.
Syntax
HRESULT Configure(
[in] VMSerialPortType portType,
[in] BSTR portName,
[in] VARIANT_BOOL vmConnectImmediately
);
Parameters
-
portType [in]
-
The type of serial port. For a list of values, see VMSerialPortType.
-
portName [in]
-
The name of the serial port. For example, "COM1" for vmSerialPort_HostPort, "C:\SerialPort.txt" for vmSerialPort_TextFile, or "\\servername\pipe\pipename" for vmSerialPort_NamedPipe.
-
vmConnectImmediately [in]
-
TRUE if the host serial port should be opened immediately when the virtual machine is started and FALSE otherwise. Ignored if portType is not vmSerialPort_HostPort.
Return value
This method can return one of these values.
Return code/value | Description |
---|---|
|
The operation was successful. |
|
The portType parameter is not valid. |
|
An unexpected error has occurred. |
|
The portName parameter is NULL. |
|
There is not enough memory available to complete this request. |
|
The path specified by the portName parameter is too long. The path must be less than MAX_PATH (260) characters. |
|
The portName parameter contains an invalid character (one of "*?<>/|":"). |
|
The portName parameter specifies an empty or relative path. An absolute path is required. |
|
The configuration for this virtual machine is not valid. |
|
The specified port is already in use. |
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows 7 [desktop apps only] |
Minimum supported server |
None supported |
End of client support |
Windows 7 |
Product |
Windows Virtual PC |
Header |
|
IID |
IID_IVMSerialPort is defined as 2ce4460d-1d3f-4458-bf8b-44084b816815 |