Establish temporary network connectivity
Applies To: Windows 8, Windows 8.1
Telecommunication applications cannot initiate long-term connections. However, if you need temporary connectivity to a specific network, you can use the Mobile Broadband API as follows:
Create an instance of CLSID_MbnConnectionManager.
Register to the IID_MbnConnectionEvents connection point.
Create an instance of CLSID_MbnInterfaceManager.
Get an IMbnInterface interface for the device by passing the account device ID into MbnInterfaceManager::GetInterface. (For more info, see Unlock a device.)
Obtain an IMbnConnection interface for the device by calling IMbnInterface::GetConnection.
Establish a connection by calling IMbnConnection::Connect. The connectionMode parameter must be set to MBN_CONNECTION_MODE_TMP_PROFILE, and the strProfile parameter must be a mobile broadband profile description.
The results of the connect attempt are returned by using the IMbnConnectionEvents::OnConnectComplete method. To disconnect when you are finished, invoke the IMbnConnection::Disconnect method. Status is returned by using IMbnConnectionEvents::OnDisconnectComplete.