compact-framework

Call JavaScript function from .NET Compact Framework in WebBrowser control

╄→гoц情女王★ 提交于 2019-12-07 11:08:54
问题 Is there anyway to call a JavaScript function from .NET Compact Framework through the WebBrowser control? 回答1: It works with the Navigate() Method. I just tried it with the Windows Mobile 5.0 Pocket PC Emulator. For example: webBrowser1.DocumentText = @"<html><head> <script type='text/javascript'> function doIt() { alert('hello again'); return 'i did it!'; } </script> </head><body>hello!</body></html>"; webBrowser1.Navigate(new Uri("javascript:doIt()")); 来源: https://stackoverflow.com

Designing data access for Compact Framework and Full Framework

安稳与你 提交于 2019-12-07 10:42:30
问题 We currently have a desktop app which uses data from SQL CE. We used Entity Framework for our ORM layer to the database and all data access methods are built around this. Now we have to build a smaller scaled down "clone" of this app for Windows CE 6.0 on the Compact Framework, also using the same SQL CE database design as on the desktop version. The problem is that compact framework does not support Entity Framework, so we are forced to access the database the old fashioned way (ADO.net,

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 get an image to a pictureBox from an URL? (Windows Mobile)

↘锁芯ラ 提交于 2019-12-07 08:39:13
问题 What and how is the best way to get an image from an URL when using the Compact Framework? I have googled around, but could not find any decent answers. Something i found was this (made a function out of it): public Bitmap getImageFromUrl() { HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(this.SImageUrl); request.Timeout = 5000; // 5 seconds in milliseconds request.ReadWriteTimeout = 20000; // allow up to 20 seconds to elapse HttpWebResponse response = (HttpWebResponse)request

JSON.NET Visual Studio 2008 and .NET 3.5 Compact Framework

邮差的信 提交于 2019-12-07 08:30:40
问题 Can I use JSON.NET in Visual Studio 2008 with .NET 3.5 Compact Framework? And how can I install/Configure it in the IDE? I've searched the internet but could not find it. I found this NuGet Support for Visual Studio 2008 to try install JSON.NET through NuGet but could not get it working. The result of this tutorial was an error Unable to find package 'your.package.name' : 回答1: I don't think NuGet will help you here. Json.NET removed support for the .NET 3.5 Compact Framework in release 4.0.1,

How to read GPS signal strength in Windows Mobile?

老子叫甜甜 提交于 2019-12-07 08:27:31
问题 How can I read the GPS signal strength from my Compact .NET app in Windows Mobile 5 and/or 6? I've only seen accessors for GPRS and Wi-Fi signal strength in the API. 回答1: Check out the GPS Application Windows Mobile code sample at MSDN. It's what taught me most of what I needed to know to get started with Hineini. 来源: https://stackoverflow.com/questions/2064996/how-to-read-gps-signal-strength-in-windows-mobile

Windows Mobile 6.5 Gestures and C# 2.0 Application

夙愿已清 提交于 2019-12-07 06:07:19
问题 I am looking for some advice on handling WM 6.5 Gestures in a C# 2.0 Application. Currently things like pan and scroll are interfering with controls like the Tab Control and listviews. Is there a way to catch these using C# 2.0 and handling them? I've been looking at the MSDN wrappers etc but these are built using .Net 3.5 and wont work with my application and I keep getting errors. Thanks for your help in advance, Morris 回答1: Using Gestures in Windows Mobile 6.5 try this 回答2: Why don't use

Create monochrome bitmap in Compact Framework

喜欢而已 提交于 2019-12-07 04:35:40
问题 I need to create a Bitmap object using raw bytes representing monochrome bitmap data. On the full framework, I am doing the following: Bitmap bmp = new Bitmap(width, height, PixelFormat.Format8bppIndexed) BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.WriteOnly, bmp.PixelFormat); // Write my data into bmpData.Scan0 bmp.UnlockBits(bmpData); Unfortunately, the Compact Framework doesn't have the PixelFormat.Format8bppIndexed enum value. So how can I

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