compact-framework

C# in VS2005: Can a device project target both full framework and CF?

↘锁芯ラ 提交于 2020-01-01 05:50:16
问题 We're developing with Compact Framework for a device under Visual Studio 2005. However we want to make an emulated version of the software as well, running at the PC (preferably selectable via a Build Configuration). It seems however that the .vsproj file is specific for devices; there is no way to use the full .NET framework for example by just changing the target. Is there any way around this? I suppose we can run the compact framework on the PC, but still the project can't target for

How can I use OpenStreetMap in my Compact Framework App?

十年热恋 提交于 2020-01-01 05:30:11
问题 Does anyone know, how I can use OpenStreetMap inside my Compact Framework application? Is there a Framework or something like that? All I can find in their wiki is how to contribute to their project and to user their software to map data. But I want to use their maps to show the users location inside my own app. I could not find anything about using their web service or whatever I have to use to show their maps inside my application. 回答1: There is a project on Google Code that wants to create

Asynchronous programming design pattern

混江龙づ霸主 提交于 2020-01-01 03:48:25
问题 I'm working on a little technical framework for CF.NET and my question is, how should I code the asynchronous part? Read many things on MSDN but isn't clear for me. So, here is the code : public class A { public IAsyncResult BeginExecute(AsyncCallback callback) { // What should I put here ? } public void EndExecute() { // What should I put here ? } public void Execute() { Thread.Sleep(1000 * 10); } } If someone can help me... Thanks ! 回答1: You could use a delegate: public class A { public

Can an app written with .net Compact Framework restart itself?

我的梦境 提交于 2020-01-01 03:31:07
问题 Can an app written with .net Compact Framework restart itself? What are some of the common patterns to achieve this? I would like to have a self-updating application that restarts itself if update was done. Of course, I could have 2 .exe: one that updates and the actual app, but I would rather just have one. 回答1: Absolutely. It's actually way easier to do than on the desktop. If you're using the SDF, use this: var thisName = Assembly.GetExecutingAssembly().GetName().CodeBase; var time =

CE 6.0 / .NET CF 3.5 Application has encountered a serious error (MC3100)

风格不统一 提交于 2020-01-01 03:10:11
问题 When exiting my .NET CF 3.5 application on the Motorola MC3100 (CE 6.0 version only) I get the error message "Application xxx has encountered a serious error and needs to shut down". I then need to warm boot the device for the application to work again. This code works fine until the application is shutdown and it only fails if a font is set on a control in the application. Everything also works fine on .NET CF 2.0 and all of the other Motorola, Intermec, Psion, HHC devices I have tried with

Detecting 'Network Cable Unplugged' in the Compact Framework

不羁的心 提交于 2019-12-31 17:14:18
问题 I've been through all of the Stack Overflow answers search comes up with, and neither Google or Bing are showing me any love. I need to know when a network cable has been connected or disconnected on a Windows CE device, preferrably, from a Compact Framework application. 回答1: I realize I'm answering my own question here, but it was actually a question asked of via email, and I actually spent quite a while finding the answer, so I'm posting it here. So the general answer for how this is

How can I remove the oldest lines in a file when using a FileStream and StreamWriter?

梦想与她 提交于 2019-12-31 07:31:41
问题 Based on Prakash's answer here, I thought I'd try something like this to remove the oldest lines in a file prior to adding a new line to it: private ExceptionLoggingService() { _fileStream = File.OpenWrite(GetExecutionFolder() + "\\Application.log"); _streamWriter = new StreamWriter(_fileStream); } public void WriteLog(string message) { const int MAX_LINES_DESIRED = 1000; StringBuilder formattedMessage = new StringBuilder(); formattedMessage.AppendLine("Date: " + DateTime.Now.ToString());

Exception after upgrading .net compact framework version

十年热恋 提交于 2019-12-31 07:25:07
问题 I have upgraded my project from .NET 2.0 to .NET 3.5 through visual studio Project-> Upgrade Project . After upgrade when i compile the project i got the error 'The type 'System.Windows.Forms.DataGridTableStyle' exists in both 'c:\Users\VijayVignesh\Desktop\AGMobile4\Dll\Other\System.Windows.Forms.DataGrid.dll' and 'c:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Windows.Forms.dll''. Typically two dlls are refernced in my project System.Windows.Forms.dll and

Conversion of C/C++ Struct To C#.Net CF WinCE

可紊 提交于 2019-12-31 05:00:49
问题 Hi I am trying to convert the C/C++ Strcut to C# C/C++ Struct looks like: typedef struct _NDISUIO_QUERY_OID { NDIS_OID Oid; PTCHAR ptcDeviceName; UCHAR Data[sizeof(ULONG)]; } NDISUIO_QUERY_OID, *PNDISUIO_QUERY_OID; My C# Struct is: [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct _NDISUIO_QUERY_OID { public uint Oid; [MarshalAs(UnmanagedType.LPWStr)] public string ptcDeviceName; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8*sizeof(uint))] public string Data;

How to create a Smart Device installer with CF 3.5 and SQL Server CE included?

混江龙づ霸主 提交于 2019-12-31 04:31:07
问题 after having my first look into the Visual Studio (2008) installation/setup project template for Smart Devices and wondering how unintuitive this is, and after searching the net for about an hour and paging through my CF books, I still have not been able to find out how I can create a setup package (.cab file, Setup.exe, whatever) that includes my Compact Framework 3.5 application as well as CF 3.5 itself and SQL Server CE, so that the prerequisites get installed if necessary with my