none
Sending SMS using Windows 7 API

    Question

  • I am trying to send an SMS using the Windows 7 API. I have the latest Win7 SDK (v7.1) and .Net 4 installed.

    I found this paper from Microsoft to implement it using managed code. I mean it looks straight forward. Please see the link.
    http://msdn.microsoft.com/en-us/windows/hardware/gg487392

    However, before I even get up to that point, when I attempt to get the necessary interfaces I get this exception.


    MbnInterfaceManager mbnInfMgr = new MbnInterfaceManager();

    IMbnInterfaceManager iMbnInterfaceManager = (IMbnInterfaceManager)mbnInfMgr;

     

    Array interfaces = iMbnInterfaceManager.GetInterfaces(); // Error line.

    COMException was unhandled
    Element not found. (Exception from HRESULT: 0x80070490).

    I don’t understand the error code. I have also searched the internet for similar problems and code samples to no avail.

    As a note I also tried the sample C++ project from Microsoft 7 SDK and get the same error when the code tries to get the interfaces on line 240 in mbapi.cpp.

           hr = g_InterfaceMgr->GetInterfaces(&psa); // Element not found (error code 0x80070490)

     

    C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\netds\MB\mbapi

    Oh I also tried it on another Windows 7 machine to no avail.

    Any assistance would be very much appreciated! I will also try and expand on anything I have covered if it will help come to a solution!

    Here is a tester project that throws the error in C#

    http://rapidshare.com/files/454305192/SMS_Windows_API_tester.zip

     

    Kevin


    Firewolf
    Friday, March 25, 2011 10:26 AM

All replies

  • I'm guessing you already noticed this, but on the page you link to, it says "This white paper provides guidelines and key steps for software developers on how to call the Windows mobile broadband API" so I'm guessing the interfaces/API only exist in the mobile OS .NET.
    Saturday, November 26, 2011 5:04 PM
  • It depends on how you place the braces :)

    (Windows Mobile) broadband API or Windows (Mobile Broadband) API

    In this case the 2nd reading is correct and it does apply to the "big" Win7. The OP did not mention wherher he has some MB device on the machine. Maybe the interface provider won't work until some MB driver is installed.

    -- pa

    Sunday, November 27, 2011 10:32 AM