compact-framework

Windows CE deletes .NET CF on reset

风格不统一 提交于 2019-11-28 21:41:46
问题 I'm writing a C# application for a proprietary Windows CE 4.2 device (for which I don't have the specs or pretty much any other information. I've got access to the file system, and that is basically it.) I also can't get support from the original manufacturer. Now, I can install the .NET Compact framework just fine, and everything works for a while. But every once in a while, when the device is reset, it deletes the framework, the GAC, everything related to it. I know it's not just a hard

Save and Load image SQLite C#

旧巷老猫 提交于 2019-11-28 18:56:18
I'm trying to save and load images with SQLite with an app on WinForm with CF. I found a way to save an image into the db but I don't know if it's right because I couldn't find a way to load the image stored in the db. I have a code to convert my image into a Base64: public void ImageToBase64(Image image, System.Drawing.Imaging.ImageFormat format){ using (MemoryStream ms = new MemoryStream()){ // Convert Image to byte[] image.Save(ms, format); byte[] imageBytes = ms.ToArray(); // Convert byte[] to Base64 String string base64String = Convert.ToBase64String(imageBytes); SaveImage(base64String);

Reading from the serial port in C#

旧巷老猫 提交于 2019-11-28 16:35:32
I have tried using Readline() and data gets dropped, I tried using Read() but I am not sure how to have an error proof method of doing it, since I may get several packets one after another and I have no way of knowing that there is going to be another packet coming in. In between packets BytesToRead is 0, so I can't use it. When reading data to the buffer to you have a timer or put the thread to sleep to allow for all the packets to arrive? I am lost. Don't know what to try next. I should mention that I get no guarantee that the string coming off the serial port will be ended with \n or \r or

Get Host-IPs of wireless network

点点圈 提交于 2019-11-28 14:52:41
Possible Duplicate: Get all IP-Hosts in Lan from mobile device How can I get programmaticaly all the hosts in a wireless network? I know the wlan I'm working in and I am connected to it. Now I want to show a list of the hosts (or at least their IP-Addresses). How can I accomplish this, and are there special points if I work on windows mobile with compact framework and want to do that? There are lots of ways. For example: ARP: http://msdn.microsoft.com/en-us/library/aa366358%28VS.85%29.aspx WMI: http://weblogs.sqlteam.com/mladenp/archive/2010/11/04/find-only-physical-network-adapters-with-wmi

How to programmatically install a font

 ̄綄美尐妖づ 提交于 2019-11-28 14:00:49
I would like to install a specific font on my program load and use that font in rendering text of the program. How can I programmatically install a font from .NET CF on WinCE 6. This blog entry shows how to enumerate and add Fonts in Windows CE using native code. For managed code, this will work: internal class FontHelper { private delegate int EnumFontFamProc(IntPtr lpelf, IntPtr lpntm, uint FontType, IntPtr lParam); private List<string> m_fonts = new List<string>(); public FontHelper() { RefreshFontList(); } public void RefreshFontList() { m_fonts.Clear(); var dc = GetDC(IntPtr.Zero); var d

Which SqlServerCe DLL version do I need to reference in my project to match what's in sqlce.wce4.armv4.CAB?

老子叫甜甜 提交于 2019-11-28 13:48:59
问题 The "rest of the story" is told below in all its gory details, but to cut to the chase, it comes down to this: SQLCE 2.0 (contained in sqlce.wce4.armv4.CAB) seems to be installed on the device on which my app runs; the source project references SqlServerCe with a Runtime Version of v2.0.50727 and a Version of 3.5.1.0 Is this a match or a mismatch? If the latter, which version of SqlServerCe.dll do I need to reference in my project? THE REST OF THE GORY STORY My Windows CE app is failing when

What is wrong with this HttpWebRequest/HttpWebResponse code (why is it considered a “bad” request (400))? [closed]

旧城冷巷雨未停 提交于 2019-11-28 13:05:55
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . Based on the info from this MS link, I've got the following code in a Windows CE / Compact Framework app which calls a REST method in a Web API server app: public static string SendXMLFile2(string uri, string data) { //TODO: Remove below after testing String s = data.Substring(0, 128); MessageBox

What is the best mechanism for communicating cross-process in Windows CE?

你说的曾经没有我的故事 提交于 2019-11-28 12:53:51
I need to broadcast an event that can be picked up by any application running on a Windows CE 5 device. Haven't done this before so i'd be interested in knowing what techniques people would suggest to see if there is anything i've not considered. All of the applications that need to receive this event are .NET Compact Framework based so "managed-only" solutions can be considered. I swear I've answered this somewhere - here, newsgroups, blog, something - but I can't find it, so here it is again: You really have 4 options for IPC under Windows CE. I'll focus on CF solutions here. Use a socket.

P/Invoking CreateToolhelp32Snapshot failing in Compact Framework

让人想犯罪 __ 提交于 2019-11-28 11:41:26
问题 Hey, im doing a little app for my smart phone, using Windows Mobile 6. I'm trying to get all currently running processec, but method CreateToolhelp32Snapshot always returns -1. So now im stuck. I tried to get error with invoking GetLastError() method, but that method returns 0 value. Here is a snippet of my code. private const int TH32CS_SNAPPROCESS = 0x00000002; [DllImport("toolhelp.dll")] public static extern IntPtr CreateToolhelp32Snapshot(uint flags, uint processid); public static Process

Change file LastWriteDate in Compact Framework

梦想的初衷 提交于 2019-11-28 10:13:55
问题 FileSystemInfo.LastWriteTime property is readonly in CF. Is there an alternative way to change that date? 回答1: P/Invoke SetFileTime. EDIT Something along these lines (warning: untested) [DllImport("coredll.dll")] private static extern bool SetFileTime(string path, ref long creationTime, ref long lastAccessTime, ref long lastWriteTime); public void SetFileTimes(string path, DateTime time) { var ft = time.ToFileTime(); SetFileTime(path, ref ft, ref ft, ref ft); } 回答2: Here is a fuller