串行端口在WM6.5而不是WM6.1上引发参数超出范围异常 [英] Serial Port throws Argument Out of Range Exception on WM6.5 and not on WM6.1

查看:57
本文介绍了串行端口在WM6.5而不是WM6.1上引发参数超出范围异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我刚刚将WM应用程序从WM 6.1迁移到WM 6.5.除了我尝试打开串行端口以连接到某些蓝牙硬件之外,该应用程序都可以正常工作.
硬件已与WM设备配对,并且如果我进入了蓝牙设置并选择连接",则可以连接到该设备.因此证明我的应用程序(COM2)中具有正确的端口号.
但是,当我尝试使用该应用程序连接到硬件时,首先会看到WM6.5提示您选择连接蓝牙快捷方式.这很烦人,因此有一种禁用此方法的方法,以使应用程序像在WM6.1上运行时一样,仅连接到指定的COM端口.其次,当我选择正确的快捷方式时,应用程序将引发带有参数消息的Argument Out of Range Exception:

此异常有一条错误消息,但无法显示,因为这些消息是可选消息,并且当前未安装在此设备上.对于Windows Mobile 5.0及更高版本,请安装"NETCFv35.Messages.EN.wb.cab",对于其他平台,请安装"NETCFv35.Messages.EN.cab".重新启动应用程序以查看消息.


我已经安装了"NETCFv35.Messages.EN.wm.cab",但这对提供更有用的错误消息没有任何影响.

Port初始化的所有参数似乎都是正确的,或者至少是我期望的.

任何帮助将不胜感激.

应用程序运行的硬件是HTC移动设备,与以前运行的硬件相同,只是处理器更快,内存更多等.

非常感谢.

安迪
(MCTS)
:confused:

Hi,
I have just recently migrated my WM application from WM 6.1 to WM 6.5. The application all works OK apart from when I try to open up the serial port to connect to some Bluetooth hardware.
The hardware is paired to the WM device and I can connect to the device if I go to the Bluetooth settings and select connect. Thus proving I have the correct port number in my application (COM2).
However, when I try to connect to the hardware using the application, firstly I see a prompt from WM6.5 to select a connection Bluetooth shortcut. This is most annoying so is there a way of disabling this so that the application just connects to the specified COM port as it did when running on WM6.1. Secondly when I select the correct shortcut the application then throws an Argument Out of Range Exception with a message:

An error message is available for this exception but cannot be displayed because these messages are optional and are not currently installed on this device. Please install ‘NETCFv35.Messages.EN.wm.cab’ for Windows Mobile 5.0 and above or ‘NETCFv35.Messages.EN.cab’ for other platforms. Restart the application to see the message.


I have installed the ''NETCFv35.Messages.EN.wm.cab’ but this has not made any difference to providing a more useful error message.

All the parameters for Port initialization seem to be correct or at least what I would expect.

Any help would be most appreciated.

The hardware what the application is running on is a HTC mobile which is the same as what it previously ran on albeit a faster processor, more memory etc.

Many Thanks.

Andy
(MCTS)
:confused:

推荐答案

好,加上一点Google"n我就找到了答案.删除System.IO.Serial端口库,并使用来自openNETcf的openNETCF.IO.Serial库.这很好.尽管在连接设备时,我仍然没有设法阻止烦人的弹出窗口.如果有人知道该怎么做,请告诉我.

安迪
(MCTS).
OK, with a bit of Google''n I have found the answer. Drop the System.IO.Serial Port library and use the openNETCF.IO.Serial library from openNETcf. This works fine. Although I still haven''t managed to prevent the annoying pop-up when you connect to the device. If anybody knows how to do this, let me know.

Andy
(MCTS).


这篇关于串行端口在WM6.5而不是WM6.1上引发参数超出范围异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆