windows-ce

How to “catch” unhandled Exceptions

核能气质少年 提交于 2019-12-07 10:00:24
We've developed a .NET 3.5 CF Application and we're experiencing some application crashes due to unhandled exceptions, thrown in some lib code. The application terminates and the standard application popup exception message box is shown. Is there a way to catch all unhandled exceptions? Or at least, catch the text from the message box. Most of our customers simply restart the device, so that we're not able to have a look on the exception message box. Any ideas? Have you added an UnhandledException event handler? [MTAThread] static void Main(string[] args) { AppDomain.CurrentDomain

How can I programmatically determine if a table exists within a SQL Server CE database?

荒凉一梦 提交于 2019-12-07 09:13:47
问题 Back when I only had one table in my .sdf file, this code worked fine: const string sdfPath = @"\Program Files\duckbilled\Platypus.sdf"; string dataSource = string.Format("Data Source={0}", sdfPath); if (!File.Exists(sdfPath)) { using (var engine = new SqlCeEngine(dataSource)) { engine.CreateDatabase(); } using (var connection = new SqlCeConnection(dataSource)) { connection.Open(); using (var command = new SqlCeCommand()) { command.Connection = connection; command.CommandText = "CREATE TABLE

How to create applications for Windows CE

隐身守侯 提交于 2019-12-07 06:43:07
问题 I'm new to the CE environment and I was wanting to create applications for a computer(Intel) running on CE(5 and up). What exactly do I need to to get started and where do I go? I have never used CE before but I do have experience writing code in C, C++, C#, and Java. Thanks, 回答1: If you are interested in writing application using C#, do a little search for Compact Framework (CF). It is the stripped down version available in Windows CE. Keep in mind that Windows CE is a highly customizable OS

HOWTO: Call Managed C# Interface From Unmanaged C++ On WindowsCE Compact Framework

十年热恋 提交于 2019-12-07 03:54:25
问题 I have extensive unmanaged Windows CE 5 C++ code that provides a UI that I want to use in a new product by combining it with a large amount of newer business and communications logic written in managed C# on Windows CE 6 and the Compact Framework. The UI may know about the business logic, but I want the business logic ignorant of the UI such that I can later replace it with a managed version, or any other UI that I choose as a front-end. I found an article that describes how to use COM as the

Async/await for compact framework v3.5 - manual implementation

筅森魡賤 提交于 2019-12-07 01:30:45
问题 I have to develop an application for WinCE 5.0 which communicates/synchronizes data with a regular PC application which offers a webservice I can talk to with my mobile (industrial) device. Since it is obvious to result in code which is hard to maintain on the mobile device side (check connection → when completed: check webservice availability → when completed: check whether mobile device is eligible for syncing → when completed start exchanging data) I would love to use the syncronous way of

How to use GC.KeepAlive() and for what purpose?

这一生的挚爱 提交于 2019-12-06 18:51:50
问题 How to use GC.KeepAlive() and for what purpose? I transfer file from terminal (Windows-CE) to Server using Socket. The time that need to transfer is 8 minutes.A fter 5 minutes the Windows-CE shut-down (if touch screen not pressed) If I use GC.KeepAlive() for this, does this my problem? 回答1: You very rarely need to use GC.KeepAlive - very rarely. You'd use it if you wanted to prevent the side-effect of a finalizer from occurring too early, for example. I've most often seen it used for Mutex -

How to automate importing certificates on a Windows CE device?

*爱你&永不变心* 提交于 2019-12-06 16:35:29
I'd like to automate importing cert(s) on a Windows CE device. Pushing the certs down to the devices is not a problem, but once they are there I cannot determine how to import them without using the UI. (I'm currently using Avalanche Mobility Center) Another way to push certificates onto windows mobile devices is to use Windows Mobile Device Provisioning. MSDN Provisioning Mobile Devices Article For examples of certificate provisioning, in any of the Windows Mobile SDK directories, there is a SDKTools directory with examples xml files. e.g. on a standard VS 2008 install with the SmartDeice SDK

How can I read a string from OpenNETCF.IO.Ports.SerialPort?

爱⌒轻易说出口 提交于 2019-12-06 15:37:40
I write commands to a belt printer using OpenNETCF.IO.Ports.SerialPort this way: public static bool SendCommandToPrinter(string cmd) { bool success; // init'd to false by default try { SerialPort serialPort = new SerialPort(); serialPort.BaudRate = 19200; serialPort.Handshake = Handshake.XOnXOff; serialPort.Open(); serialPort.Write(cmd); serialPort.Close(); success = true; } catch // may not need a try/catch block, as success defaults to false { success = false; } return success; } ...now I need to read a value returned from a "get val" call, but I don't know how, and I haven't been able to

Compact Framework - get all open forms

旧城冷巷雨未停 提交于 2019-12-06 14:32:15
问题 I am making a Windows CE application in which the user can change the GUI language at runtime. I have implemented my own translation logic in the Load event of the form. Now, I would like to update all open forms when the user changes the language. Is there a way (in Compact Framework!!) to retrieve all open forms of the application? 回答1: You can create a FormManager class that you use to instantiate all of your forms. This would give the manager the opportunity to track the lifespan of those

VS2005 and Windows CE 6.0 Debugging

空扰寡人 提交于 2019-12-06 11:04:54
问题 Firstly, I'm running VS2005 SP1 and Windows 7 Ultimate. I'm trying to debug an application of mine on a device running Windows CE 6.0. I have done a lot of digging and it seems a large amount people have a similar difficulty but it's caused by a broad range problems and if there are any solutions, none of them have helped me so far. My problem is that I cannot target WinCE 6.0 when I debug. The only devices I am able to target are: Pocket PC 2003 Device Windows CE 5.0 Device Windows Mobile 5