compact-framework

Watermarked Textbox for Compact Framework

旧街凉风 提交于 2019-11-28 06:11:10
问题 Does anyone know if anyone makes a watermarked textbox control for the compact framework? I already loked at the following and didn't see one. Component One Mobile Pocket PC Controls Resco Mobile Forms Toolkit 回答1: Daniel Moth has a pretty good blog post about how to do this here: TextBox with cue banner support for Windows Mobile Best of all it is simple and free! 回答2: I've never seen one. This project shows how to do it yourself - not sure if it would work on CF, but I didn't see any

P/Invoking function via a mangled name

六眼飞鱼酱① 提交于 2019-11-28 05:38:55
问题 I'm trying to call an function in an unmanaged c++ dll in .net cf 3.5 in a windows ce 6.0 environment. The struct is defined as: typedef struct TagOperatorInfo { DWORD dwMode; DWORD dwFormat; //Operator name format DWORD dwAct; //Network type(Available in 3G module£ºGSM or 3G), TCHAR szOper[32]; }OperatorInfo,*LPOperatorInfo; and the function call is: BOOL GetCurOperatorInfo(LPOperatorInfo pinfo); I defined in .net the TagOperatorInfo as follows: [System.Runtime.InteropServices

How can I determine whether a column exists in a SQL Server CE table with C#?

对着背影说爱祢 提交于 2019-11-28 04:39:32
问题 The legacy code does it this way: public bool isValidField(string tableName, string fieldName) { bool retVal; string tblQuery = string.Format("SELECT {0} FROM {1}", fieldName, tableName); checkConnection(); try { SqlCeCommand cmd = objCon.CreateCommand(); cmd.CommandText = tblQuery; object objvalid = cmd.ExecuteScalar(); retVal = (null != objvalid); } catch { retVal = false; } return retVal; } ...but I find it doesn't always work. After calling that method, and getting false , some code

Windows Mobile Compact Framework Build Error: CAB file … could not be created

冷暖自知 提交于 2019-11-28 04:08:46
问题 I get the following error when trying to build a .CAB in visual studio on my new PC. The source is identical. The Registry warnings are not present on the old PC either. Windows CE CAB Wizard Warning: Section [RegKeys] has no data Warning: Section [DefaultInstall] key "AddReg" - there are no section entries to process Error: CAB file "D:\Dev\...\MyProject.CAB" could not be created ERROR: The Windows CE CAB Wizard encountered an error. See the output window for more information. No other

How to safely store encryption key in a .NET assembly

蓝咒 提交于 2019-11-28 03:11:27
问题 In order to prevent somebody from grabbing my data easily, I cache data from my service as encrypted files (copy protection, basically). However, in order to do this, I must store the encryption key within the .NET assembly so it is able to encrypt and decrypt these files. Being aware of tools like Red Gate's .NET Reflector which can pull my key right out, I get a feeling that this is not a very safe way of doing it... are there any best practices to doing this? 回答1: You have to decide what

Can't find PInvoke DLL error in Windows Mobile

廉价感情. 提交于 2019-11-28 02:53:54
问题 I am having a lot of trouble getting a basic scenario to work on windows mobile 5.0 emulator. I have a winforms app that eventually calls into native code. Deployment works fine and all the native DLLs are copied in the same folder as the winforms .exe. I also verified this is the case with Remote File Viewer tool. However when I launch my app, it always fails with "Can't find PInvoke dll -- System.MissingMethodException" error (when the time comes to call into native code, the DllImport

C#/SQL - What's wrong with SqlDbType.Xml in procedures?

不问归期 提交于 2019-11-28 02:01:53
I've asked few people why using xml as a parameter in stored procedure doesn't work and everyone said , that's just the way it is. I can't belive that. command.Parameters.Add("@xmldoc", SqlDbType.Xml); That's where compiler returns error and I can't use NVarChar beacouse it's limiteed to 4k sings. XML would be perfect as it can be 2gigs big. How come other SqlDbTypes work well and this one retruns error ? * Error: Specified argument was out of the range of valid values. Parameter name: @xmldoc: Invalid SqlDbType enumeration value: 25. * Gregory A Beamer It does work. You will have to set up

Partly crashing application? How can I catch uncatchable exceptions?

 ̄綄美尐妖づ 提交于 2019-11-28 01:52:12
I have a program written in C#, running on a Windows CE device (on Compact Framework). It processes minimal user actions (button clicks), uses serial port and TCP/IP communication. The problem is sometimes the software shuts down on its own. In the background the application (or parts of the application) seems to be still running (at least in one documented case it was) because it uses the serial port, so restarting the application doesn't help. I can't reproduce the problem since it happens in most of the cases when there is no user interaction, no serial port communication and the network

Uri.EscapeDataString() - Invalid URI: The Uri string is too long

巧了我就是萌 提交于 2019-11-28 01:47:15
I'm using compact framework/C# on windows mobile. In my application I am uploading data to the server by serializing objects and using a HttpWebRequest/POST request to send the information up. On the server the post data is de-serialised and saved to the db. The other day I realised that I had a problem with special characters in the post data (ampersands etc..). So I introduced Uri.EscapeDataString() into the method and all was well. However, today I have discovered that there is a problem when the application attempts to upload a large amount of data (I'm unsure of what exactly denotes

OutOfMemoryException loading big image to Bitmap object with the Compact Framework

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 01:30:00
问题 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