日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

P/Invoke调用SipEnumIM枚举SIP失败?

發布時間:2023/12/19 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 P/Invoke调用SipEnumIM枚举SIP失败? 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

通過.NET CF本身提供的方法枚舉設備中的所有SIP可以方便的完成這個問題。如下: 參考:http://msdn.microsoft.com/en-us/library/ms172538.aspx ?? ? ? ?//?定義一個InputPanel?
?? ? ? ?private?InputPanel?m_inputPanel?=?new?InputPanel();
?? ? ? ?
?? ? ? ?//?枚舉SIP
?? ? ? ?foreach?(InputMethod?method?in?m_inputPanel.InputMethods)
?? ? ? ?{
?? ? ? ? ? ?
this.listBox.Items.Add(method.Name);
?? ? ? ?}

通過上面的方式枚舉設備所有SIP后,就可以選擇自己需要的SIP了 參考: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;
????????????????}
????????????}
????????}




參考: http://www.developer.com/ws/pc/article.php/10947_3583686_1/Managing-the-Software-Input-Panel-in-Your-Applications.htm http://www.pcreview.co.uk/forums/thread-2610504.php ASK: 我想P/Invoke系統API來實現.NET CF為我們實現的枚舉功能,如下代碼,但是總是返回0,也就是沒有枚舉到,請問,是我的結構體參數設置錯誤還是其他呢? ?? ?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)
????????{
????????????SIPs.Add(IMinfo);
????????????
return?1;
????????}

????????
public?List<IMENUMINFO>?GetSIPs()
????????{
????????????
int?imcount?=?SipEnumIM(SipEnumIMProc);
????????????
return?SIPs;
????????}

????????
public?class?IMENUMINFO
????????{
????????????
public?StringBuilder?szName;
????????????
public?Guid?clsid;
????????????
????????????
public?IMENUMINFO()
????????????{
????????????????szName?
=?new?StringBuilder();
????????????????clsid?
=?new?Guid();
????????????}
????????}
????}


????
//?按照下面方式調用
????SIPManager?sipmgr?=?new?SIPManager();
????List
<SIPManager.IMENUMINFO>?list?=?new?List<SIPManager.IMENUMINFO>();
????list?
=?sipmgr.GetSIPs();

????
//?但是每次跟蹤進GetSIPs之后,里面imcount返回值總為0,也就是表示失敗







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

李森?– listen
E-mail:??lisencool@gmail.com

聲明:
這里集中了在WinCEWindows Mobile開發中的一些基本常識。我很樂意和大家分享,也希望大家提出意見,并給我投稿,我會第一時間替您發表并署上您的大名!

Announce:
Here collects general knowledge on WinCE and Windows mobile. I 'm very glad 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.

??

轉載于:https://www.cnblogs.com/Lisen/archive/2009/09/17/1568754.html

總結

以上是生活随笔為你收集整理的P/Invoke调用SipEnumIM枚举SIP失败?的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。