0

The following code exits before it finishes with no exception:

    private void Form1_Load(object sender, EventArgs e)
    {
        MbnConnectionManager connectionManager = new MbnConnectionManager();
        IMbnConnectionManager connectionManagerInterface = (IMbnConnectionManager)connectionManager;
       IMbnConnection[] connections = (IMbnConnection[])connectionManagerInterface.GetConnections();


       (IMbnConnectionProfileManager)connectionProfile;
        MbnApi.MbnInterfaceManager interfaceManager = new MbnInterfaceManager();
        MbnApi.IMbnInterfaceManager interfaceManagerInterface = (IMbnInterfaceManager)interfaceManager;

        IMbnInterface[] interfaces = interfaceManagerInterface.GetInterfaces() as IMbnInterface[];

        foreach (IMbnInterface mbnInterface in interfaces)
        {
            MBN_PROVIDER homeProvider = mbnInterface.GetHomeProvider(out homeProvider);
        }

    }

This line seems to be causing the crash -

MBN_PROVIDER homeProvider = mbnInterface.GetHomeProvider(out homeProvider);

Why would this occur and is there any way to see what is really happening inside the Mobile Broadband API?

jeroenh
  • 26,362
  • 10
  • 73
  • 104
Adam Baxter
  • 1,907
  • 21
  • 41

1 Answers1

2

Have you registered a broadband device in your system?

  1. Open your network and sharing center and see if there is a Mobile Broadband Connection device.
  2. Try to run the following command: netsh mbn show interfaces
JRoughan
  • 1,635
  • 12
  • 32
Tomas Oplt
  • 36
  • 2
  • I no longer have access to the device I was testing this with, but I will check if any other devices I have use this API. For anyone else searching for information on this it seems like Huawei devices *do not* use this API. Thanks for your answer - good to have extra info at any rate. – Adam Baxter Dec 27 '11 at 10:59
  • netsh>mbn show interfaces There is no Mobile Broadband interface – Adam Baxter Dec 27 '11 at 11:16
  • It depends on the device driver whether the device uses MBN API. This is specified by the device provider (telecom company), who gets a customised driver, not the manufacturer. – user1725145 Aug 27 '13 at 08:45