IMbnMultiCarrier::ScanNetwork 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.

Scans the network to get a list of visible providers for a multi-carrier device.

Syntax

HRESULT ScanNetwork(
  [out] ULONG *requestID
);

Parameters

[out] requestID

Pointer to the request ID set by the operating system for this request. The asynchronous response from OnScanNetworkComplete will contain this same requestID.

Return value

This method can return one of these values.

Return code Description
S_OK
The method completed successfully.
HRESULT_FROM_WIN32(ERROR_SERVICE_NOT_ACTIVE)
The Mobile Broadband service is not running on this system.
E_HANDLE
The interface is invalid. Most likely because the Mobile Broadband device has been removed from the system.
HRESULT_FROM_WIN32(ERROR_NOT_FOUND)
The interface is invalid. Most likely because the Mobile Broadband device has been removed from the system.
HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)
The operation is not supported by the device. This may be returned by devices which do not support multi-carrier.

Remarks

This method initiates a network scan operation. When completed successfully, it populates the operating system's cache of visible providers and applications can call the GetVisibleProviders method of IMbnMultiCarrier to get a list of visible networks.

This is a time consuming operation. Therefore, applications should first call GetVisibleProviders and should call ScanNetwork only when the cached information is old.

This is an asynchronous operation and ScanNetwork will return immediately. If this method returns successfully (with S_OK), then upon completion of the scan operation, the operating system will call the OnScanNetworkComplete method of IMbnMultiCarrierEvents to notify the application of operation completion.

If the device is removed from the system before this operation is complete, there is no guarantee that the completion notification will be received by the application.

Requirements

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

See also

IMbnMultiCarrier