I have the following code running on Windows 7:
MbnInterfaceManager mbnInfMgr = new MbnInterfaceManager(); IMbnInterfaceManager mbnInfMgrInterface = mbnInfMgr as IMbnInterfaceManager; if (mbnInfMgrInterface != null) { IMbnInterface[] mobileInterfaces = mbnInfMgrInterface.GetInterfaces() as IMbnInterface[]; }
There is no problem when the MBN device exists, but when the MBN device does not exist, I get the following exception in the call to GetInterfaces ():
{System.Runtime.InteropServices.COMException (0x80070490): The item was not found. (Exception from HRESULT: 0x80070490) in MbnApi.IMbnInterfaceManager.GetInterfaces () in foo.Program.configureConnection () in foo}
Question Is there something that needs to be done to check the MBN interface before calling GetInterfaces? I can just catch this exception, but I cannot find the documentation that says this exception is the same as the lack of interfaces.
The closest I found in statckoverflow is struggling with mobile broadband api windows 7 and windows 8 with C #, not sure what to install, that maybe Windows 7 behaves differently than Windows 8.1.
source share