compact-framework

OutOfMemoryException loading big image to Bitmap object with the Compact Framework

一笑奈何 提交于 2019-11-29 07:49:31
I have a problem with a memory leak. I have this code in a button_click : Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim ms As New IO.MemoryStream Dim bm As New Bitmap("\Application Data\imgs\IMG22.jpg") bm.Save(ms, Drawing.Imaging.ImageFormat.Jpeg) End Sub This code works just fine when I'm running the .exe at my laptop (I mean under windows7/32bits with the full .net framework) but when I run the app in a device with WindowsMobile 6.1 the app throws this exception: SmartDeviceProject22.exe OutOfMemoryException at Microsoft.AGL

Get ip address of host pc from windows mobile when connected via ActiveSync

為{幸葍}努か 提交于 2019-11-29 07:32:44
I have a .Net Compact app running on Windows Mobile, and I want to be able to connect to a webservice running on the 'host' machine (i.e. the desktop the PDA is plugged into) when connected via ActiveSync, but I don't know the ip address of the host. How can I find the ip of the desktop PC progromatically on the PDA? I've found a KB article How To Retrieve the IP Address of the Remote PPP Peer , which uses the host "PPP_Peer". So I tried: Dns.GetHostEntry("PPP_Peer").AddressList[0] And that does give me what I'm looking for (169.254.2.2 on the PC I'm using at the moment). Getting the address

Know who got the focus in a Lost Focus event

人走茶凉 提交于 2019-11-29 06:44:58
Is it possible to know who got the focus in a lost focus event? Compact Framework does not have an ActiveControl , so I don't know how to tell who got the focus. Vaccano This is the solution that ended up working: public System.Windows.Forms.Control FindFocusedControl() { return FindFocusedControl(this); } public static System.Windows.Forms.Control FindFocusedControl(System.Windows.Forms.Control container) { foreach (System.Windows.Forms.Control childControl in container.Controls) { if (childControl.Focused) { return childControl; } } foreach (System.Windows.Forms.Control childControl in

How do you get the current battery level in .NET CF 3.5?

℡╲_俬逩灬. 提交于 2019-11-29 05:18:40
How - or what's the best way - to retrieve the device's current battery level in .NET CF 3.5 on Windows Mobile 5 and 6? Noldorin I think you want to use the Microsoft.WindowsMobile.Status namepsace (specifically the SystemState class. using Microsoft.WindowsMobile.Status; ... BatteryLevel batteryLevel = SystemState.PowerBatteryStrength; BatteryState batteryState = SystemState.PowerBatteryState; See this post for the full code sample. You probably want the State Notification Broker class that Noldorin is recommending. I don't think it gives you very fine grain information. You get information

is there a clean way to play an mp3 sound in the compact framework 3.5

て烟熏妆下的殇ゞ 提交于 2019-11-29 05:07:24
I use the p/invoke method to play wav sounds. There are ways of calling windows media player to play an mp3 sound, but its slow & cumbersome. Is there an easy way to play a short mp3 file? This is primarily for application prompting and audible cues when you are not looking at the screen and not music. Thanks! CF Framework 3.5 now includes support for playing .WAV files: Namespace System.Media.SoundPlayer Short WAV files for cues and sound-effects might even play faster than MP3s since they're "ready-to-play"... If you are looking for a way to play mp3s: public class Sound { [DllImport(

ETA on Smart Device Projects for Visual Studio 2010

↘锁芯ラ 提交于 2019-11-29 04:52:54
I really want to upgrade to Visual Studio 2010. But since I do a lot of development for the Pocket PC version of Windows Mobile I cannot. (I develop for a Symbol device that does not support Windows Phone 7, so that is not a option.) Does any one know any kind of time frame of when Microsoft plans to add support for Smart Device Projects into Visual Studio 2010? Update: Since this is looking less and less likely without intervention from the users, Please go here and vote for this feature. Microsoft's current public statement says that, apart from Windows Phone 7 development, there will not be

Playing YouTube videos in a Windows Mobile application

旧时模样 提交于 2019-11-29 04:17:39
问题 I am working on an application for Windows Mobile 6 (or maybe 5) that plays YouTube videos. Well, it should play YouTube videos (and control/query the player about status changes, current frame/time, etc.) After scouring the web for quite some time now (and a few trials), I still couldn't find a way to do this. The options I know of are: Use the YouTube player, embedded in HTML, controllable via JavaScript. However, I couldn't watch YT videos from IE Mobile, to begin with -- I get an error

Set columns width in a datagrid using Compact Framework

亡梦爱人 提交于 2019-11-29 03:10:39
问题 I'm trying to set the width of the columns in my datagrid. I use Compact Framework 2.0 and C# I tried this but it gives me an "out of bonds" error message: foreach (DataGridColumnStyle vColumnStyle in dataGrid1.TableStyles[0].GridColumnStyles) { vColumnStyle.Width = 100; } Here is the code for filling my datagrid with the datatable (only fails when I try to set the columns width): void FillData() { // 1 // Open connection string conString = "Data Source=\\Program Files\\smartdeviceproject2\

System.Text.Encoding.GetEncoding(“iso-8859-1”) throws PlatformNotSupportedException?

人走茶凉 提交于 2019-11-29 01:33:58
See subject, note that this question only applies to the .NET compact framework. This happens on the emulators that ship with Windows Mobile 6 Professional SDK as well as on my English HTC Touch Pro (all .NET CF 3.5). iso-8859-1 stands for Western European (ISO), which is probably the most important encoding besides us-ascii (at least when one goes by the number of usenet posts). I'm having a hard time to understand why this encoding is not supported, while the following ones are supported (again on both the emulators & my HTC): iso-8859-2 (Central European (ISO)) iso-8859-3 (Latin 3 (ISO))

3rd Party UI components for .net Compact Framework? [closed]

不问归期 提交于 2019-11-29 01:11:07
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I have a .Net compact framework application with a frankly unimpressive UI. My win32 app uses Dev Express components and looks great,