SetDefaultCommConfigW function (winbase.h)

Sets the default configuration for a communications device.

Syntax

BOOL SetDefaultCommConfigW(
  [in] LPCWSTR      lpszName,
  [in] LPCOMMCONFIG lpCC,
  [in] DWORD        dwSize
);

Parameters

[in] lpszName

The name of the device. For example, COM1 through COM9 are serial ports and LPT1 through LPT9 are parallel ports.

[in] lpCC

A pointer to a COMMCONFIG structure.

[in] dwSize

The size of the structure pointed to by lpCC, in bytes.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

Note

The winbase.h header defines SetDefaultCommConfig as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows XP
Minimum supported server Windows Server 2003
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

COMMCONFIG

Communications Functions

Communications Resources

GetDefaultCommConfig