P/invoke failed to call sipenumim to enumerate sip?

Source: Internet
Author: User
You can use the method provided by. Net CF itself to enumerate all the SIP messages on the device. See: http://msdn.microsoft.com/en-us/library/ms172538.aspx // Define an inputpanel
Private Inputpanel m_inputpanel =   New Inputpanel ();

// Enumerative sip
Foreach (Inputmethod Method In M_inputpanel.inputmethods)
{
This . ListBox. Items. Add (method. Name );
}
After enumerating all the SIP devices through the above method, you can choose your desired sip reference: http://msdn.microsoft.com/en-us/library/microsoft.windowsce.forms.inputpanel.currentinputmethod.aspx Private   Void Setnewsip ( String Sipname)
{
Foreach (Inputmethod Method In M_inputpanel.inputmethods)
{
If (Sipname. Equals (method. Name ))
{
M_inputpanel.currentinputmethod = Method;
Break ;
}
}
} Reference: http://www.developer.com/ws/pc/article.php/10947_3583686_1/Managing-the-Software-Input-Panel-in-Your-Applications.htmhttp://www.pcreview.co.uk/forums/thread-2610504.php Ask: I want the P/invoke system API to implement the. NET CF enumeration function for us, as follows: Code But it always returns 0, that is, it is not enumerated. Is it my structure parameter setting error or something else? Public   Class Sipmanager
{
Public   Delegate   Int Imenumproc ( Ref Imenuminfo iminfo );
[Dllimport ( " Coredll. dll " )]
Public   Static   Extern   Int Sipenumim (imenumproc enumimproc );
Private List < Imenuminfo > Sips =   New List < Imenuminfo > ();

Public int sipenumimproc ( ref imenuminfo iminfo)
{< br> sips. add (iminfo);
return 1 ;
}

PublicList<Imenuminfo>Getsips ()
{
IntImcount=Sipenumim (sipenumimproc );
ReturnSIPs;
}

Public   Class Imenuminfo
{
Public Stringbuilder szname;
Public Guid CLSID;

Public Imenuminfo ()
{
Szname =   New Stringbuilder ();
CLSID =   New GUID ();
}
}
}

// Call
Sipmanager sipmgr =   New Sipmanager ();
List < Sipmanager. imenuminfo > List =   New List < Sipmanager. imenuminfo > ();
List = Sipmgr. getsips ();

//However, after each trace is added to getsips, The imcount returned value is always 0, indicating that the request failed.

 

--------------------------------------------------

Lee Sen-Listen
E-mail: lisencool@gmail.com

Statement:
Here we focus onWinCEAndWindows MobileSome basic knowledge in development. I would like to share with you, and I hope you will give your comments and contribute to me. I will post your name for you as soon as possible!

Announce:
Here collects general knowledge on WinCE and Windows Mobile. i'm very gglad to share them with all friends, and also hope you can share your problems and opinions and contribute articles to me to share with others. i'll publish your articles and sign your name at the first time.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.