Share via


CmAddConnectionConfig (Compact 7)

3/12/2014

This function adds a new connection along with its settings.

Syntax

CM_RESULT CmAddConnectionConfig(
    __in const WCHAR* pszConnection,
    __in_bcount(cbConfig) CM_CONNECTION_CONFIG* pConfig,
    __in DWORD cbConfig
);

Parameters

Return Value

Returns one of the following values from the CM_RESULT enumeration:

Value Description

CMRE_SUCCESS

The operation completed successfully.

CMRE_INVALID_CONNECTION

The pszConnection name is not valid.

CMRE_INVALID_PARAMETER

The pConfig or cbConfig parameter is not valid.

CMRE_INVALID_CONNECTION_TYPE

No loaded Connection Service Provider (CSP) handles the connection type.

CMRE_CONNECTION_ALREADY_EXISTS

A connection of the same name already exists.

CMRE_OUT_OF_MEMORY

Memory can not be allocated to complete the operation.

CMRE_INVALID_VERSION

The Connection Manager Common Constants of one or more of the pConfig structures is not supported.

CMRE_UNEXPECTED

An unexpected failure occurred.

Remarks

The name of the connection must be unique.

Requirements

Header

cmnet.h

Library

cmnet.lib

See Also

Reference

Connection Manager Connection Configuration Functions