IMbnConnectionProfileManager::CreateConnectionProfile method (mbnapi.h)

Important

Starting in Windows 10, version 1803, the Win32 APIs described in this section are replaced by the Windows Runtime APIs in the Windows.Networking.Connectivity namespace.

Creates a new connection profile for the device.

Syntax

HRESULT CreateConnectionProfile(
  [in] LPCWSTR xmlProfile
);

Parameters

[in] xmlProfile

A null-terminated string that contains the profile data in XML format compliant with the Mobile Broadband Profile Schema Reference.

Return value

This method can return one of these values.

Return code Description
S_OK
The method completed successfully.
HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS)
A profile with the given name already exists.
E_MBN_INVALID_PROFILE
The profile does not conform to the Mobile Broadband profile schema.
HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
The icon file location passed in the profile is not valid or not accessible.
E_MBN_DEFAULT_PROFILE_EXIST
The calling application specified the default profile flag in the XML data, however the default profile already exists for the Mobile Broadband device.

Remarks

This is a synchronous operation. If this function call is successful, then a new profile will be created and the Mobile Broadband service will call the OnConnectionProfileArrival method of the IMbnConnectionProfileManagerEvents interface.

If the icon file location is specified in the profile data then the Mobile Broadband service will copy the icon file from the specified location in its own store. A subsequent query on the IMbnConnectionProfile object for the icon file location will return the file location where the Mobile Broadband service stored the icon file. Whenever a profile is deleted from the system, its icon file is also deleted from the system. The icon file should be in bmp file format file with 32x32 pixel dimensions.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header mbnapi.h

See also

IMbnConnectionProfileManager