IMbnConnectionProfileManager::CreateConnectionProfile method (mbnapi.h)


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.


HRESULT CreateConnectionProfile(
  [in] LPCWSTR xmlProfile


[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
The method completed successfully.
A profile with the given name already exists.
The profile does not conform to the Mobile Broadband profile schema.
The icon file location passed in the profile is not valid or not accessible.
The calling application specified the default profile flag in the XML data, however the default profile already exists for the Mobile Broadband device.


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.


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

See also