locked
profile name in Connect method of IMbnConnection (MBIM)

    Question

  • Hi All,

    I am  writing a test code in C# using MbnApi. I am facing a problem when I try to connect to a network. Getting an ELEMENT_NOT_FOUND exception.

    code:

    1st method

    conn.Connect(MBN_CONNECTION_MODE.MBN_CONNECTION_MODE_PROFILE, "my airtel", out requestID);

    2nd method (xml)

     string profileXml = connEvtsSink.ConstructProfileXml("Airtel","404450114360944", "airtelgprs.com", "", "");

                conn.Connect(MBN_CONNECTION_MODE.MBN_CONNECTION_MODE_TMP_PROFILE,
                    profileXml,
                    out requestID);

    My target system has Win8.1, and a 3g modem, visual studio 2012 Professional.

    All other IMbn interfaces work fine.

    Can anyone help me with this problem.

    Regards,

    Dushyant

    Monday, September 2, 2013 5:57 AM

Answers

All replies

  • Hi All,

    I am writing a test code in C# to use the device services of a 3g device using MBIM interfaces. (Using MbnApi)

    code:

    Array z = Array.CreateInstance(typeof(Array),30);
                
                
                if (mbnDeviceService4.IsCommandSessionOpen == 1)
                {
                    Console.WriteLine("   Command session is open " );

                    mbnDeviceService4.QueryCommand(cmdid,z , out reqID);
               
                }

    at QueryCommand, the system throws a runtime exception of type SafeArrayTypeMismatch. Details say Specified array was not of the expected type.

    In msdn, the signature of QueryCommand in C++ is 

    HRESULT QueryCommand( [in]   ULONG commandID, [in]   SAFEARRAY(BYTE) deviceServiceData, [out]  ULONG *requestID );

    But I am using C# MbnApi where the signature is

    void QueryCommand(uint commandID, Array deviceServiceData, out uint requestID);.

    Can anyone help me resolve this exception.

    Regards,

    Dushyant

    Monday, September 2, 2013 6:38 AM
  • Hi there,

    I merged your threads because they are just for one question, and I'm trying to find if someone have experience with such issue.

    Thanks for supporting Windows Store app Dev forum

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.



    Tuesday, September 3, 2013 2:48 AM
    Moderator
  • Hi James,

    Actually they both are two different questions, if you see the content. Though theyre for same API interface. Do you think its ok to leave them in the same thread?

    Regards,

    Dushyant

    Thursday, September 5, 2013 6:02 AM
  • Hi Dushyant,

    I agree that they are different questions, one is for "ELEMENT_NOT_FOUND" exception and another is "SafeArrayTypeMismatch" exception, but the questions comes from how to use the same API(MbnApi), that's the reason I merge them, I think if someone has the experience will provide you some possible solutions for MdnAPi at the same time. Meanwhile if you think it's not ok, I can separate it for you.

    So please be patient. And sorry for not asking you if you wish to merge or not.

    Besides,I found some document which will probably help you: http://msdn.microsoft.com/en-us/library/windows/desktop/ee677092(v=vs.85).aspx, or download a document. Again, a sample from code center is more relative with your question: http://code.msdn.microsoft.com/windowsapps/Modern-Win32COM-mobile-8f762ad8

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.




    Thursday, September 5, 2013 6:18 AM
    Moderator
  • From a support perspective this is really beyond what we can do here in the forums. If you cannot determine your answer here or on your own, consider opening a support case with us. Visit this link to see the various support options that are available to better meet your needs: 
    Tuesday, October 1, 2013 8:03 PM