Search Results

Search found 1942 results on 78 pages for 'compact disc'.

Page 17/78 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • How to refactor this database to allow sync. with smart clients?

    - by Anton Zvgny
    Howdy, I have inherited the following database: http://i46.tinypic.com/einvjr.png (EDIT: I cannot post images, so here goes the link) This currently runs 100% online thru an Asp.Net web app , but some employees will need to have offline access to this database to either get documents or to insert new documents for later synchronization when back to the office. What changes need to be made to this database scheme to support such scenario (sync smart clients with central web database)? Thanks! ps. I'm not an developer/dba, i'm just an mechanic engineer tasked with changing this app, so, take it easy on me :D ps1. We're using MSSQL Server for the online central database and MSSQL Compact for the smart client. ps2. the ImageGuid field of the images table is used to save the images to the file system. The web app takes the guid and create folders according to the first 3 initial letters to persist the image to the file system. ps3. The users of the smart client not always get server data first and then go modifying to sync later the changes. Most of the time they start working completely offline (with a blank local database) and later sync the data to the server. ps4. All the users of the smart client app have an account at the web app.

    Read the article

  • SQL Server CE rollback does not undo delete.

    - by INTPnerd
    I am using SQL Server CE 3.5 and C# with the .NET Compact Framework 3.5. In my code I am inserting a row, then starting a transaction, then deleting that row from a table, and then doing a rollback on that transaction. But this does not undo the deletion. Why not? Here is my code: SqlCeConnection conn = ConnectionSingleton.Instance; conn.Open(); UsersTable table = new UsersTable(); table.DeleteAll(); MessageBox.Show("user count in beginning after delete: " + table.CountAll()); table.Insert( new User(){Id = 0, IsManager = true, Pwd = "1234", Username = "Me"}); MessageBox.Show("user count after insert: " + table.CountAll()); SqlCeTransaction transaction = conn.BeginTransaction(); table.DeleteAll(); transaction.Rollback(); transaction.Dispose(); MessageBox.Show("user count after rollback delete all: " + table.CountAll()); The messages indicate that everything works as expected until the very end where the table has a count of 0 indicating the rollback did not undo the deletion.

    Read the article

  • Programmatically setup a PEAP connection in Windows Mobile

    - by tomlog
    I have been working on this for a few days and this is doing my head in: Our application is built using the .NET Compact Framework 2.0 and running on Windows Mobile 5 & 6 devices. We can set the WLAN connection of the device programmatically using the Wireless Zero Config functions (described here: msdn.microsoft.com/en-us/library/ms894771.aspx), most notably the WZCSetInterface function which we pinvoke from our application. This works fine for WEP and WPA-PSK connections. In a recent effort to add support for WPA2 networks we decided to modify the code. We have successfully added support for WPA2 which uses a certificate for the 802.1x authentication by setting the correct registry settings before calling WZCSetInterface. Now we want to do the same for WPA2 using PEAP (MS-CHAPv2) authentication. When manually creating such a connection in Windows Mobile the user will be prompted to enter the domain/user/password details. In our application we will have those details stored locally and want to do this all programmatically without any user intervention. So I thought going along the same route as the certificate authentication, setting the correct registry entries before calling WZCSetInterface. The registry settings we set are: \HKCU\Comm\EAP\Config\[ssid name] Enable8021x = 1 (DWORD) LastAuthSuccessful = 1 (DWORD) EapTypeId = 25 (DWORD) Identity = "domain\username" (string) Password = binary blob containing the password that is encrypted using the CryptProtectData function (described here: msdn.microsoft.com/en-us/library/ms938309.aspx) But when these settings are set and I call WZCSetInterface with the correct parameters, it still prompts me with the User Logon dialog asking for the domain/username/password. Has anyone got an idea what I need to do to prevent the password dialog from appearing and connect straight away with the settings stored in the registry?

    Read the article

  • SerialPort ReadLine() after Thread.Sleep() goes crazy

    - by Mat
    Hi everybody, I've been fighting with this issue for a day and I can't find answer for it. I am trying to read data from GPS device trough COM port in Compact Framework C#. I am using SerialPort class (actually my own ComPort class boxing SerialPort, but it adds only two fields I need, nothing special). Anyway.. I am running while loop in a separate thread which reads line from the port, analyze NMEA data, print them, catch all exceptions and then I Sleep(200) the thread, cause I need CPU for other threads... Without Sleep it works fine, but uses 100% CPU.. When I dont use Sleep after few minutes the output from COM port looks like this: GPGSA,A,3,09,12,22,17,15,27,,,,,,,2.6,1.6,2.1*3F GSA,A,3,09,12,22,17,15,27,,,,,,,2.6,1.6,2.1*3F A,A,3,09,12,22,17,15,27,,,,,,,2.6,1.6,2.1*3F ,18,12,271,24,24,05,020,24,14,04,326,25,11,03,023,*76 A,3,09,12,22,17,15,27,,,,,,,2.6,1.6,2.1*3F 3,09,12,22,17,15,27,,,,,,,2.6,1.6,2.1*3F 09,12,22,17,15,27,,,,,,,2.6,1.6,2.1*3F ,12,22,17,15,27,,,,,,,2.6,1.6,2.1*3F as you can see the same message is read few times but cut. I wonder what I'm doing wrong... My port configuration: port.ReadBufferSize = 4096; port.BaudRate = 4800; port.DataBits = 8; port.Parity = Parity.None; port.StopBits = StopBits.One; port.NewLine = "\r\n"; port.ReadTimeout = 1000; port.ReceivedBytesThreshold = 100000; And my reading function: private void processGps(){ while (!closing) { //reconnect if needed try { string sentence = port.ReadLine(); //here print the sentence //analyze the sentence (this takes some time 50-100ms) } catch (TimeoutException) { Thread.Sleep(0); } catch (IOException ioex) { //handling IO exception (some info on the screen) } Thread.Sleep(200); } } There is some more stuff in this function like reconnection if the device is lost etc.. but it is not called when the GPS is connected properly.. I was trying port.DiscardInBuffer(); after some blocks of code (in TimeoutException, after read..) Did anyone had similar problem? I really dont know what I'm doing wrong.. The only way to get rig of it is removing the last Sleep... Thanks in advance! Best Regards, Mat

    Read the article

  • In Protobuf-net how can I pass an array of type object with objects of different types inside, knowi

    - by cloudraven
    I am trying to migrate existing code that uses XmlSerializer to protobuf-net due to the increased performance it offers, however I am having problems with this specific case. I have an object[] that includes parameters that are going to be sent to a remote host (sort of a custom mini rpc facility). I know the set of types from which these parameters can be, but I cannot tell in advance in which order they are going to be sent. I have three constraints. The first is that I am running in Compact Framework, so I need something that works there. Second, as I mentioned performance is a big concern (on the serializing side) so I would rather avoid using a lot of reflection there if possible. And the most important is that I care about the order in which this parameters were sent. Using XmlSerializer it was easy just adding XmlInclude, but for fields there is nothing equivalent as far as I know in Protobuf-net. So, is there a way to do this? Here is a simplified example. [Serializable] [XmlInclude(typeof(MyType1)), XmlInclude(typeof(MyType2)), XmlInclude(typeof(MyType3)) public class Message() { public object[] parameters; public Message(object[] parms) { parameters = parms; } } Message m = new Message(new object[] {MyType1(), 33, "test", new MyType3(), new MyType3()}); MemoryStream ms = new MemoryStream(); XmlSerializer xml = new XmlSerializer(typeof(Message)); xml.Serialize(ms,xml); That will just work with XmlSerializer, but if I try to convert it to protobuf-net I will get a "No default encoding for Object" message. The best I came up with is to use generics and [ProtoInclude] as seen in this example. Since I can have different object types within the array this doesn't quite make it. I added a generic List for each potential type and a property with [ProtoIgnore] with type object[] to add them and get them. I have to use reflection when adding them (to know in which array to put each item) which is not desirable and I still can't preserve the ordering as I just extract all the items on each list one by one and put them into a new object[] array on the property get. I wonder if there is a way to accomplish this?

    Read the article

  • Not able to create Live CD

    - by Jagannath Harati
    I downloaded 12.04.1 on a Windows 7 machine. I burnt a DVD from the ISO image using Windows Disc Image Burner. I had 'verify disc' on. The disc was created successfully with no errors. I was not able to use this disc for installing Ubuntu on another Windows 7 machine. I do not get the Welcome Screen on booting. I find that on the disc I burnt, I do not find bin, disc tree, programs directories and cdromupgrade, start.*, ubuntu* files. I found the boot directory and WUBI executable file. I tried downloading several times with the same result. I had similar problem earlier with 11.04. Can you please let me where the problem is?

    Read the article

  • "Could not establish secure channel for SSL/TLS" in .NET CF application on smart phone

    - by Stefan Mohr
    I have a stubborn communications issue with an application running on the .NET Compact Framework 3.5 on Windows Mobile smartphones. I am constructing a web request using this code: UTF8Encoding encoding = new System.Text.UTF8Encoding(); byte[] Data = encoding.GetBytes(HttpUtility.ConstructQueryString(parameters)); httpRequest = WebRequest.Create((domain)) as HttpWebRequest; httpRequest.Timeout = 10000000; httpRequest.ReadWriteTimeout = 10000000; httpRequest.Credentials = CredentialCache.DefaultCredentials; httpRequest.Method = "POST"; httpRequest.ContentType = "application/x-www-form-urlencoded"; httpRequest.ContentLength = Data.Length; Stream SendReq = httpRequest.GetRequestStream(); SendReq.Write(Data, 0, Data.Length); SendReq.Close(); HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse(); return httpResponse.GetResponseStream(); The web service functions by receiving a JSON-encoded document as part of the URL (eg. https://site.com/ws/sync??document={"version":"1.0.0","items":[{"item_1":"item1"}]}&user=usr&password=pw), and as a response receives another JSON document as response data. This code runs fine on all emulators and PDAs running WM 5 and 6. We have seen an issue with a couple of customers running Treo smartphones (and only on the Sprint network). We have tested the code on an identical device on the AT&T network (via DeviceAnywhere) and once again the code worked as we expected. This has to be some sort of security policy on the phone, but we've been unable to determine a workaround or diagnose it thoroughly as we cannot reproduce it in house and have had to resort to getting users to assist with running test drivers for us. When this code executes, the user's device throws the following exception: System.Net.WebException Could not establish secure channel for SSL/TLS Stack trace: at System.Net.HttpWebRequest.finishGetRequestStream() at System.Net.HttpWebRequest.GetRequestStream() at OurApp.GetResponseStream(String domain, Hashtable parameters) inner exception: System.IO.IOException Authentication failed because the remote party has closed the transport stream. Stack trace: at System.Net.SslConnectionState.ClientSideHandshake() at System.Net.SslConnectionState.PerformClientHandShake() at System.Net.Connection.connect(Object ignored) at System.Threading.ThreadPool.WorkItem.doWork(Object o) at System.Threading.Timer.ring() Examining the server Apache logs shows no hits from the user's IP - I don't think the device is even attempting to send a packet before failing. If relevant, the server is running Apache on Linux and is written using the TurboGears Python framework. The server certificate is issued by a CA and is still valid. The test driver where this error was copied from was not code signed, however the same error (without the error messages) is signed with a GeoTrust certificate so we don't believe this is a code signing issue. The application installs and launches without issue on all phones - it's just establishing this SSL connection that is breaking for these users. One significant issue in troubleshooting is that there is a substantial inconvenience each time we try out a solution (need to find a "volunteer" customer), so we're really looking for a silver bullet or a better understanding of the handshaking process so we can be reasonably confident we only need to ask the user to test it one or two more times. One final mention: we have tried the sync both over ActiveSync and also over GPRS with identical results. Any thoughts would be greatly appreciated!

    Read the article

  • How to play VOB files that were inside a DVD disc?

    - by Cristian
    I just downloaded a DVD which is for a movie. After uncompressing the DVD file I see .VOB, .IFO and .BUP files. If I open the first .VOB file it shows me the DVD menu but I can't interact with it. So, my question is... is Totem able to play those kind of files? If so, how can I achieve that? What other app could I use in order to reproduce those files? Edit Using VLC didn't work neither. I forgot to mention I have already tried that. Let me rephrase: if I open the first video file it shows the DVD menu, BUT I can't interact with it.

    Read the article

  • Black screen white cursor and can't boot from live disc that I installed from just yesterday (Ubuntu 12.04)

    - by Luke
    So, I've decided to change to Ubuntu from Windows 7 after reformatting. Install goes smoothly, I've set everything up, and it works for a day. It crashed when I had a full screen video, froze, so I rebooted, and now I can't get past the black screen with flashing white underscore cursor. If I wait a while, I get "Reboot and Select proper Boot device or Insert Boot Media in selected Boot device and press any key" I've tried that, removed any boot options but the DVD drive, even tried my Windows 7 boot CD as well. Nothing boots, so I can't do anything. This is on an Asus A52N laptop, and all I can access now is the BIOS (version K52N 217), as far as I can tell.

    Read the article

  • What is the difference between the "Entire Partition" and "Entire Disc"?

    - by Roman
    I want to install Ubuntu alongside my Windows 7 operation system. During installation I have three options: Install alongside the existing OS. Remove everything and install Ubuntu. Manual partitioning (advanced). The above list is not precise (I do not remember what exactly was written there and I just write options as I have understood them). I know that option 2 is not mine. So, I need to choose either 1 or 3. I do not know which one I need to choose. I want to have a possibility to manually specify space assigned to Windows and Ubuntu (for example 40% for Windows and 60% for Ubuntu). I chose the 1st option and I saw a window with the following information. Allocate drive space by dragging the drive bellow. File (48.1 GB) Ubuntu /dev/sda2 (ntfs) /dev/sda3 (ext4) 286.6 GB 241.7 GB 2 small partitions are hidden, use the advanced partitioning tool for more control. [use entire partition] [use entire disk] [Quit] [Back] [Install Now] My problem is that I do not understand what I see. In particular I can press [use entire partition] or [use entire disk] and I do not know what is the difference. Moreover, as far as I understand, I can even press [Install Now] without pressing one of the two above mentioned buttons. So, I have 3 options. What is the difference between them? The most important thing for me is not to delete the old operation system with all the data stored there.

    Read the article

  • SqlCeException: The column cannot be modified. [ Column name = id ]

    - by pek
    I am simply trying to add a single row in the database but I keep getting an exception. I created a local database and added a single table: users. It consists of two columns: "id" and "name". I only made the id primary key (not auto-increment or anything else). When I run the following code: string execPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase); string dbfile = execPath + @"\LocalDatabase.sdf"; SqlCeConnection conn = new SqlCeConnection("datasource=" + dbfile); conn.Open(); string command = "INSERT INTO users VALUES('1','pek')"; Debug.WriteLine(command); SqlCeCommand comm = conn.CreateCommand(); comm.CommandText = command; comm.ExecuteNonQuery(); I get the following Exception at "comm.ExecuteNonQuery();": SqlCeException was unhandled The column cannot be modified. [ Column name = id ] What's with the "modified" part?

    Read the article

  • [C#] Convert string to double with 2 digit after decimal separator

    - by st.stoqnov
    All began with these simple lines of code: string s = "16.9"; double d = Convert.ToDouble(s); d*=100; The result should be 1690.0, but it's not. d is equal to 1689.9999999999998. All I want to do is to round a double to value with 2 digit after decimal separator. Here is my function. private double RoundFloat(double Value) { float sign = (Value < 0) ? -0.01f : 0.01f; if (Math.Abs(Value) < 0.00001) Value = 0; string SVal = Value.ToString(); string DecimalSeparator = System.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalSeparator; int i = SVal.IndexOf(DecimalSeparator); if (i > 0) { int SRnd; try { // ????? ??????? ????? ???? ?????????? ?????????? SRnd = Convert.ToInt32(SVal.Substring(i + 3, 1)); } catch { SRnd = 0; } if (SVal.Length > i + 3) SVal = SVal.Substring(0, i + 3); //SVal += "00001"; try { double result = (SRnd >= 5) ? Convert.ToDouble(SVal) + sign : Convert.ToDouble(SVal); //result = Math.Round(result, 2); return result; } catch { return 0; } } else { return Value; } But again the same problem, converting from string to double is not working as I want. A workaround to this problem is to concatenate "00001" to the string and then use the Math.Round function (commented in the example above). This double value multiplied to 100 (as integer) is send to a device (cash register) and this values must be correct. I am using VS2005 + .NET CF 2.0 Is there another more "elegant" solution, I am not happy with this one.

    Read the article

  • c# opennetCF background worker - e.result gives a ObjectDisposedException

    - by ikky
    Hi! I'm new working with background worker in C#. Here is a class, and under it, you will find the instansiation of it, and under there i will define my problem for you: I have the class Drawing: class Drawing { BackgroundWorker bgWorker; ProgressBar progressBar; Panel panelHolder; public Drawing(ref ProgressBar pgbar, ref Panel panelBig) // Progressbar and panelBig as reference { this.panelHolder = panelBig; this.progressBar = pgbar; bgWorker = new BackgroundWorker(); bgWorker.WorkerReportsProgress = true; bgWorker.WorkerSupportsCancellation = true; bgWorker.DoWork += new OpenNETCF.ComponentModel.DoWorkEventHandler(this.bgWorker_DoWork); bgWorker.RunWorkerCompleted += new OpenNETCF.ComponentModel.RunWorkerCompletedEventHandler(this.bgWorker_RunWorkerCompleted); bgWorker.ProgressChanged += new OpenNETCF.ComponentModel.ProgressChangedEventHandler(this.bgWorker_ProgressChanged); } public void createDrawing() { bgWorker.RunWorkerAsync(); } private void bgWorker_DoWork(object sender, DoWorkEventArgs e) { Panel panelContainer = new Panel(); // Adding panels to the panelContainer for(i=0; i<100; i++) { Panel panelSubpanel = new Panel(); // Setting size, color, name etc.... panelContainer.Controls.Add(panelSubpanel); // Adding the subpanel to the panelContainer //Report the progress bgWorker.ReportProgress(0, i); // Reporting number of panels loaded } e.Result = imagePanel; // Send the result(a panel with lots of subpanels) as an argument } private void bgWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { this.progressBar.Value = (int)e.UserState; this.progressBar.Update(); } private void bgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Error == null) { this.panelHolder = (Panel)e.Result; } else { MessageBox.Show("An error occured, please try again"); } } } Instansiating an object of this class: public partial class Draw: Form { public Draw() { ProgressBar progressBarLoading = new ProgressBar(); // Set lots of properties on progressBarLoading Panel panelBigPanelContainer = new Panel(); Drawing drawer = new Drawing(ref progressBarLoading, ref panelBigPanelContainer); drawer.createDrawing(); // this makes the object start a new thread, loading all the panels into a panel container, while also sending the progress to this progressbar. } } Here is my problem: In the private void bgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) i don't get the e.Result as it should be. When i debug and look at the e.Result, the panel's properties have this exception message: '((System.Windows.Forms.Control)(e.Result)).ClientSize' threw an exception of type 'System.ObjectDisposedException' So the object gets disposed, but "why" is my question, and how can i fix this? I hope someone will answer me, this is making me crazy. Another question i have: Is it allowed to use "ref" with arguments? is it bad programming? Thanks in advance. I have also written how i understand the Background worker below here: This is what i think is the "rules" for background workers: bgWorker.RunWorkerAsync(); => starts a new thread. bgWorker_DoWork cannot reach the main thread without delegates - private void bgWorker_DoWork(object sender, DoWorkEventArgs e) { // The work happens here, this is a thread that is not reachable by the main thread e.Result => This is an argument which can be reached by bgWorker_RunWorkerCompleted() bgWorker.ReportProgress(progressVar); => Reports the progress to the bgWorker_ProgressChanged() } - private void bgWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { // I get the progress here, and can do stuff to the main thread from here (e.g update a control) this.ProgressBar.Value = e.ProgressPercentage; } - private void bgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { // This is where the thread is completed. // Here i can get e.Result from the bgWorker thread // From here i can reach controls in my main thread, and use e.Result in my main thread if (e.Error == null) { this.panelTileHolder = (Panel)e.Result; } else { MessageBox.Show("There was an error"); } }

    Read the article

  • running VisualStudio CF3.5 apps on WINCE

    - by marc
    Hi, I am trying to write a program for a chinese PNA device with wince 5.0. But everytime I write a simple program in VS8 with C# and 'deploy' it to my device it just doesn't run. First it complains about disposing an object call menu, although I don't want an menu but VS8 just creates one for me. If I delete the menu from the form the program gives an exception. I installed a program call MIOPocket on the PNA with has powertoys some games and MS media player. It also creates a directory .net framework 3.5 so I known 3.5 is installed and must be working. But I think I am missing something. I am also not sure what to choice as target device ; windows mobile or WINCE. If I click the .exe file under win7 it works but under wince its a no go. Maybe someone has a clue what is going wrong ?

    Read the article

  • Notification CeSetUserNotificationEx with custom sound

    - by inTagger
    Hail all! I want to display notification and play custom sound on my Windows Mobile 5/6 device. I have tried something like that, but my custom sound does not play, though message is displayed with standart sound. If i edit Wave key in [HKEY_CURRENT_USER\ControlPanel\Notifications{15F11F90-8A5F-454c-89FC-BA9B7AAB0CAD}] to sound file i need then it plays okay. But why there are flag NotificationAction.Sound and property UserNotification.Sound? It doesn't work. Also Vibration and Led don't work, if i use such flags. (You can obtain full project sources from http://dl.dropbox.com/u/1758206/Code/Thunder.zip) var trigger = new UserNotificationTrigger { StartTime = DateTime.Now + TimeSpan.FromSeconds(1), Type = NotificationType.ClassicTime }; var userNotification = new UserNotification { Sound = @"\Windows\Alarm1.wma", Text = "Hail from Penza, Russia!", Action = NotificationAction.Dialog | NotificationAction.Sound, Title = string.Empty, MaxSound = 16384 }; NotificationTools.SetUserNotification(0, trigger, userNotification); UserNotificationTrigger.cs: using System; using System.Runtime.InteropServices; namespace Thunder.Lib.ThunderMethod1 { /// <summary> /// Specifies the type of notification. /// </summary> public enum NotificationType { /// <summary> /// Equivalent to using the SetUserNotification function. /// The standard command line is supplied. /// </summary> ClassicTime = 4, /// <summary> /// System event notification. /// </summary> Event = 1, /// <summary> /// Time-based notification that is active for the time period between StartTime and EndTime. /// </summary> Period = 3, /// <summary> /// Time-based notification. /// </summary> Time = 2 } /// <summary> /// System Event Flags /// </summary> public enum NotificationEvent { None, TimeChange, SyncEnd, OnACPower, OffACPower, NetConnect, NetDisconnect, DeviceChange, IRDiscovered, RS232Detected, RestoreEnd, Wakeup, TimeZoneChange, MachineNameChange, RndisFNDetected, InternetProxyChange } /// <summary> /// Defines what event activates a notification. /// </summary> [StructLayout(LayoutKind.Sequential)] public class UserNotificationTrigger { internal int dwSize = 52; private int dwType; private int dwEvent; [MarshalAs(UnmanagedType.LPWStr)] private string lpszApplication = string.Empty; [MarshalAs(UnmanagedType.LPWStr)] private string lpszArguments; internal SYSTEMTIME stStartTime; internal SYSTEMTIME stEndTime; /// <summary> /// Specifies the type of notification. /// </summary> public NotificationType Type { get { return (NotificationType) dwType; } set { dwType = (int) value; } } /// <summary> /// Specifies the type of event should Type = Event. /// </summary> public NotificationEvent Event { get { return (NotificationEvent) dwEvent; } set { dwEvent = (int) value; } } /// <summary> /// Name of the application to execute. /// </summary> public string Application { get { return lpszApplication; } set { lpszApplication = value; } } /// <summary> /// Command line (without the application name). /// </summary> public string Arguments { get { return lpszArguments; } set { lpszArguments = value; } } /// <summary> /// Specifies the beginning of the notification period. /// </summary> public DateTime StartTime { get { return stStartTime.ToDateTime(); } set { stStartTime = SYSTEMTIME.FromDateTime(value); } } /// <summary> /// Specifies the end of the notification period. /// </summary> public DateTime EndTime { get { return stEndTime.ToDateTime(); } set { stEndTime = SYSTEMTIME.FromDateTime(value); } } } } UserNotification.cs: using System.Runtime.InteropServices; namespace Thunder.Lib.ThunderMethod1 { /// <summary> /// Contains information used for a user notification. /// </summary> [StructLayout(LayoutKind.Sequential)] public class UserNotification { private int ActionFlags; [MarshalAs(UnmanagedType.LPWStr)] private string pwszDialogTitle; [MarshalAs(UnmanagedType.LPWStr)] private string pwszDialogText; [MarshalAs(UnmanagedType.LPWStr)] private string pwszSound; private int nMaxSound; private int dwReserved; /// <summary> /// Any combination of the <see cref="T:Thunder.Lib.NotificationAction" /> members. /// </summary> /// <value>Flags which specifies the action(s) to be taken when the notification is triggered.</value> /// <remarks>Flags not valid on a given hardware platform will be ignored.</remarks> public NotificationAction Action { get { return (NotificationAction) ActionFlags; } set { ActionFlags = (int) value; } } /// <summary> /// Required if NotificationAction.Dialog is set, ignored otherwise /// </summary> public string Title { get { return pwszDialogTitle; } set { pwszDialogTitle = value; } } /// <summary> /// Required if NotificationAction.Dialog is set, ignored otherwise. /// </summary> public string Text { get { return pwszDialogText; } set { pwszDialogText = value; } } /// <summary> /// Sound string as supplied to PlaySound. /// </summary> public string Sound { get { return pwszSound; } set { pwszSound = value; } } public int MaxSound { get { return nMaxSound; } set { nMaxSound = value; } } } } NativeMethods.cs: using System; using System.Runtime.InteropServices; namespace Thunder.Lib.ThunderMethod1 { [StructLayout(LayoutKind.Sequential)] public struct SYSTEMTIME { public short wYear; public short wMonth; public short wDayOfWeek; public short wDay; public short wHour; public short wMinute; public short wSecond; public short wMillisecond; public static SYSTEMTIME FromDateTime(DateTime dt) { return new SYSTEMTIME { wYear = (short) dt.Year, wMonth = (short) dt.Month, wDayOfWeek = (short) dt.DayOfWeek, wDay = (short) dt.Day, wHour = (short) dt.Hour, wMinute = (short) dt.Minute, wSecond = (short) dt.Second, wMillisecond = (short) dt.Millisecond }; } public DateTime ToDateTime() { if ((((wYear == 0) && (wMonth == 0)) && ((wDay == 0) && (wHour == 0))) && ((wMinute == 0) && (wSecond == 0))) return DateTime.MinValue; return new DateTime(wYear, wMonth, wDay, wHour, wMinute, wSecond, wMillisecond); } } /// <summary> /// Specifies the action to take when a notification event occurs. /// </summary> [Flags] public enum NotificationAction { /// <summary> /// Displays the user notification dialog box. /// </summary> Dialog = 4, /// <summary> /// Flashes the LED. /// </summary> Led = 1, /// <summary> /// Dialog box z-order flag. /// Set if the notification dialog box should come up behind the password. /// </summary> Private = 32, /// <summary> /// Repeats the sound for 10–15 seconds. /// </summary> Repeat = 16, /// <summary> /// Plays the sound specified. /// </summary> Sound = 8, /// <summary> /// Vibrates the device. /// </summary> Vibrate = 2 } internal class NativeMethods { [DllImport("coredll.dll", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, SetLastError = true)] internal static extern int CeSetUserNotificationEx(int hNotification, UserNotificationTrigger lpTrigger, UserNotification lpUserNotification); } } NotificationTools.cs: using System.ComponentModel; using System.Runtime.InteropServices; namespace Thunder.Lib.ThunderMethod1 { public static class NotificationTools { /// <summary> /// This function modifies an existing user notification. /// </summary> /// <param name="handle">Handle of the Notification to be modified</param> /// <param name="trigger">A UserNotificationTrigger that defines what event activates a notification.</param> /// <param name="notification">A UserNotification that defines how the system should respond when a notification occurs.</param> /// <returns>Handle to the notification event if successful.</returns> public static int SetUserNotification(int handle, UserNotificationTrigger trigger, UserNotification notification) { int num = NativeMethods.CeSetUserNotificationEx(handle, trigger, notification); if (num == 0) throw new Win32Exception(Marshal.GetLastWin32Error(), "Error setting UserNotification"); return num; } } }

    Read the article

  • Resizing and saving an image in WinMobile and .NET CF throws OutOfMemoryException

    - by devguy
    I have a WinMobile app which allows the user the snap a photo with the camera, and then use for for various things. The photo can be snapped at 1600x1200, 800x600 or 640x480, but it must always be resized to 400px for the longest size (the other is proportional of course). Here's the code: private void LoadImage(string path) { Image tmpPhoto = new Bitmap(path); // calculate new bitmap size... double width = ... double height = ... // draw new bitmap Image photo = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format24bppRgb); using (Graphics g = Graphics.FromImage(photo)) { g.FillRectangle(new SolidBrush(Color.White), new Rectangle(0, 0, photo.Width, photo.Height)); int srcX = (int)((double)(tmpPhoto.Width - width) / 2d); int srcY = (int)((double)(tmpPhoto.Height - height) / 2d); g.DrawImage(tmpPhoto, new Rectangle(0, 0, photo.Width, photo.Height), new Rectangle(srcX, srcY, photo.Width, photo.Height), GraphicsUnit.Pixel); } tmpPhoto.Dispose(); // save new image and dispose photo.Save(Path.Combine(config.TempPath, config.TempPhotoFileName), System.Drawing.Imaging.ImageFormat.Jpeg); photo.Dispose(); } Now the problem is that the app breaks in the photo.Save call, with an OutOfMemoryException. And I don't know why, since I dispose the tempPhoto (with the original photo from the camera) as soon as I can, and I also dispose the Graphics obj. Why does this happen? It seems impossible to me that one can't take a photo with the camera and resize/save it without making it crash :( Should I restor t C++ for such a simple thing? Thanks.

    Read the article

  • MissingMethodException ( Can`t find PInvoke DLL 'sqlceme30.dll ' ) for Windows Mobile

    - by anyinfonet
    Hello. I have developed a win mobile (v5.0) application and I use ONLY 1 database SQLITE with these references: System.Data.SQLite.dll (assembly version & product version : 1.0.65.0); SQLite.Interop.065.DLL (product version : 1.0 and is a c++ lib for first dll ). After 5 weeks of using of this application, I get today a weird exception and I dont understand what it is? Exception is: MissingMethodException Can`t find PInvoke DLL 'sqlceme30.dll ' at System.Data.SqlServerCe.SqlCeCommand.ReleaseNativeInterfaces() at System.Data.SqlServerCe.SqlCeCommand.Dispose(Boolean disposing) ...... What`s wrong? Anyone know about this to explain me please? By the way : until now I delevoped 3-4 applications (1 year ago )using these references and everything worked fine.

    Read the article

  • There is no DoubleClick event for ListView control in .NET CF 3.5

    - by nmcy
    In my project, tree is a list of customers displayed in an ListView control, When user double clicks (or taps) on an item I should show the details of that customer, But there is no double click (or click event, mouse up and down events etc.) event in .NET CF 3.5 ListView control (we only have ItemActive and SelectedIndexChanged events) Is there anyone has figure out this problem?

    Read the article

  • OpenNETCF Signature control question

    - by Vaccano
    I am using the Signature control in OpenNETCF. It works great for most everything I need. However, I need a way invert the signature and load it back in. It has a call to get the "bytes" for the signature (GetSignatureEx()). It returns a byte[] of the signature. This signature can then be loaded back in with LoadSignatureEx(). I can't seem to figure out the system for these bytes. I thought they may be coordinates, but it does not seem so now. If anyone out there knows a way to invert the signature and load it back in, I would be grateful to hear it.

    Read the article

  • Windows-mobile app won't run after being closed by Task Manager

    - by pithyless
    I've inherited some windows-mobile code that I've been bringing up-to-date. I've come across a weird bug, and I was hoping that even though a bit vague, maybe it will spark someone's memory: Running the app (which is basically a glorified Forms app with P/Invoke gps code), I switch to the task manager, and close the app via End Task. Seems to exit fine (no errors and disappears from Task Manager). Unfortunately, the app refuses to start a second time until I reboot the phone or reinstall the CAB. What's worse: this bug is reproducible on a HTC Diamond, but works fine (ie. can run again after EndTask) on an HTC HD2. The only thing I can think of is some kind of timing race between a Dispose() and the Task Manager. Any ideas? I'm also thinking of a workaround - I do have a working "Exit Application" routine that correctly cleans up the app; can I catch the EndTask event in the c# code in order to complete a proper cleanup? Maybe I'm just missing the pain point... all ideas welcome :)

    Read the article

  • What's the best way to create a Windows Mobile application with multiple screens in C#

    - by Joseph Earl
    I am creating a Windows Mobile Application in C# and Visual Studio 2008. The application will have 5-6 main 'screens'. There will also be bar (/area) with information (e.g. a title, whether the app is busy, etc) above the screens, and a toolbar (or similar control) below the screens with 5-6 buttons (with images) to change the active screen (i.e. the screens will share the top bar and toolbar) What is the best way to implement this? Use multiple forms, and just include the toolbar and top-bar in each Use a single form and something like the Tab control (but customised) to contain the screens Something else? Keeping in mind a) memory usage and b) time to switch screens. Thanks in advance. Any links, pointers etc are much appreciated.

    Read the article

  • Unit testing .Net CF apps on Windows Mobile 6.5.3 in Visual Studio 2008

    - by Johann Gerell
    Did anyone get that to work? I mean, unit testing .Net CF apps on Windows Mobile 6.5.3 in Visual Studio 2008. It works great for a WM 6 Pro target, but not for a WM 6.5.3 target. I get this error: The test adapter ('Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapter, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.Adapter, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') required to execute this test could not be loaded. Check that the test adapter is installed properly. Not enough storage is available to process this command. Yes, I can read the error text, but I don't understand the failed run. Any clues?

    Read the article

  • CF - Set Focus to a specific control

    - by no9
    Hi ! I have a Form that has a panel with some textBoxes and checkBox that is outside the panel. Every time the Form is loaded the checkBox has focus. I have put en event handler when form loads and tried to set focus on first textbox instead having it on the checkbox. this.Activated += new EventHandler(form_Activated); in the method i try to set the focus on the first textbox in the panel private void form_Activated(object sender, EventArgs e) { if (this.parametersPanel.Controls.Count > 0) { this.parametersPanel.Focus(); (this.parametersPanel.Controls[0]).Focus(); } } This does not work, can some1 help me pls?

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >