使用Windows Mobile 6 SDK时出现GPS错误 [英] GPS Erroring when using the Windows Mobile 6 SDK

查看:86
本文介绍了使用Windows Mobile 6 SDK时出现GPS错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好(和马克)。


由于过去几周有关我的GPS应用程序的几次发布,我已经到了加入GPS的东西了我正在使用Windows Mobile 6 SDk,并为我的项目使用了Microsoft.WindowsMo​​bile.Samples.Location项目代码。


现在,问题是我收到错误,有时直接离开(一旦GPS被初始化)或在使用它期间。


我得到一个意外的发生错误,唯一的其他信息是ArgumentException参数名称字符。


以下是例外的完整详情:

ArgumentException

ArgumentException

参数名称:chars


在System.Text.UTF8Encoding.GetBytes(Char * chars,Int32 charIndex,Int32 charCount,Byte [] bytes, Int32 byteIndex,UTF8Encoder编码器)

在System.Text.UTF8Encoding.GetBytes(Char []字符,Int32字符串索引,Int32字符串,字节[]字节,Int32字节索引,UTF8Encoder编码器)

at System.Text.UTF8Encoding.UTF8Encoder.GetBytes(Char [] chars,Int32 charIndex,Int32 charCount,Byte [] bytes,Int32 byteIndex,Boolean flush)

at System.IO.StreamWriter .Flush(Boolean flushStream,Boolean flushEncoder)

在System.IO.StreamWriter.Dispose(布尔处理)

在System.IO.TextWriter.Dispose()

at Microsoft.WindowsMo​​bile.Samples.Location.Gps.GetPo sition(TimeSpan maxA ge)

at Microsoft.WindowsMo​​bile.Samples.Location.Gps.GetPo sition()

at Microsoft.WindowsMo​​bile.Samples.Location.Gps.WaitF orGpsEvents()


现在,我知道它不是来自我的软件,因为我正在调试它(不是模拟器但连接WM6设备)它表示无法加载符号进行调试。我假设它是来自Windows Mobile 6 SDK的包含DLL(Microsoft.WindowsMo​​bile.Samples.Location.dll)中的内容。


当我调试时,我可以获得Gps.cs SDK文件以显示自己(不同的原因)并且它表明它使用的DLL与cs文件相比是不同的。我没有重新编译任何东西,但想知道我使用的DLL是不是正确的,并且此错误在不同的DLL中修复(只是在这里大声思考并尝试提供所有信息)。


我见过有人在MSDN论坛上问过同样的问题,但是他被忽略了。


使用SDK的DLL时有没有人(Mark?)有同样的错误?


奇怪的是,位置示例似乎运行正常。但是,我在我的应用程序中使用完全相同的代码。


请...任何想法?


谢谢,

Rob

Hi all (and Mark).

As I have posted a few times the last few weeks about my GPS application, I have got to the point of adding the GPS stuff in. I am using the Windows Mobile 6 SDk and used the Microsoft.WindowsMobile.Samples.Location project code for my project.

Now, the problem is I am getting an error, sometimes straight away (once the GPS is initialised) or during the use of it.

I get an "unexpected" error occuring and the only other information is ArgumentException Parameter Name chars.

Here are the full details of the Exception:
ArgumentException
ArgumentException
Parameter name: chars

at System.Text.UTF8Encoding.GetBytes(Char* chars, Int32 charIndex, Int32 charCount, Byte[] bytes, Int32 byteIndex, UTF8Encoder encoder)
at System.Text.UTF8Encoding.GetBytes(Char[] chars, Int32 charIndex, Int32 charCount, Byte[] bytes, Int32 byteIndex, UTF8Encoder encoder)
at System.Text.UTF8Encoding.UTF8Encoder.GetBytes(Char[] chars, Int32 charIndex, Int32 charCount, Byte[] bytes, Int32 byteIndex, Boolean flush)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Dispose(Boolean disposing)
at System.IO.TextWriter.Dispose()
at Microsoft.WindowsMobile.Samples.Location.Gps.GetPo sition(TimeSpan maxAge)
at Microsoft.WindowsMobile.Samples.Location.Gps.GetPo sition()
at Microsoft.WindowsMobile.Samples.Location.Gps.WaitF orGpsEvents()

Now, I know it isnt coming from my software as when I am debugging it (not emulator but connected the the WM6 device) it states the symbols cannot be loaded for debug. I am presuming it is something in the included DLL (the Microsoft.WindowsMobile.Samples.Location.dll) from theWindows Mobile 6 SDK.

When I am debugging, I can get the Gps.cs SDK file to show itself (different reason) and it states the DLL it is using compared to the cs file is different. I havent recompiled anything, but wondering if the DLL I am using is NOT the correct one and this error is fixed in a different DLL (Just thinking out loud here and trying to supply all information).

I have seen someone ask the same question in MSDN forums, but he was ignored.

Has anyone (Mark?) had the same error when using the SDK''s DLL?

What is strange as it seems the Location Sample works fine. However, I am using the exact same code, in a class, within my application.

Please... Any ideas?

Thanks,
Rob

推荐答案

您可以毫无问题地构建和运行示例吗?您应该比较您的项目文件,看看您是否有一些示例项目没有的缺失设置。
You can build and run the sample without any problems? You should compare your project files and see if you have some missing settings that the sample project does not.


您好Redson,


感谢您的支持回复,但我有完全相同的代码示例。这是非常简单的代码,因为大部分工作都是由DLL完成的。 (我已仔细检查过)。


我还创建了一个新的简单应用程序,使用示例中的代码,我得到了同样的错误。应用程序不会根据样本显示值(这是唯一的区别)。我只是用信息加载一个变量,然后在按下按钮时显示它。


我实际上找到了创建DLL的SDK文件夹中的所有源代码,所以我重新编译了DLL并将使用此DLL进行测试。


Rob
Hi Redson,

Thanks for the reply, but I have exactly the same code as per the example. It is very simple code as most of the work is done by the DLL. (I have double checked).

I have also created a new simple app, with the code from the example and I get the same error. The app doesnt display the values as per the sample (thats the only difference). I just load up a variable with the information, then display it when I push a button.

I actually found all the source in the SDK folder that created the DLL, so I have recompiled the DLL and will test with this DLL.

Rob


对,如果它很简单,大部分工作都是在DLL但你遇到了问题。那么问题可能出在你的项目设置而不是你的代码中。
Right, if it''s simple and most of the work is done in the dll but you are having problems. Then the problem is likely in your project setup not your code.


这篇关于使用Windows Mobile 6 SDK时出现GPS错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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