Search Results

Search found 2806 results on 113 pages for 'winforms'.

Page 105/113 | < Previous Page | 101 102 103 104 105 106 107 108 109 110 111 112  | Next Page >

  • Translating EventAggregators usage of SynchronizationContext to VB.Net

    - by Phil Sayers
    Working with a fairly large VB.Net back office winforms application. 1 million+ LOC. Big ball of mud, 90% of all code is in Forms & other UI controls. Slowly introducing better architecture as time & recources allows, We've been using ideas from the EventAggrgator by Jeremy Miller. http://codebetter.com/blogs/jeremy.miller/archive/2008/01/11/build-your-own-cab-extensible-pub-sub-event-aggregator-with-generics.aspx Initially I stripped out the usage of SynchronizationContext. Now I'm trying to introduce it back, and I'm struggling with the translation of the lamda stuff from c# to vb.net. Specifically this line of c# _context.Send(delegate { receiver.Handle(subject); }, null); This is the vb.net I have so far: _context.Send(New SendOrPostCallback(AddressOf listener.Handle(message)), Nothing) The error I'm getting is listener.Handle(message) <-- AddressOf operand must be the name of a method. I'm sure I'm missing something simple, but after staring at this for 2 days, I'm lost.

    Read the article

  • Web Service Exception Handling

    - by SchlaWiener
    I have a Winforms app that consumes a C# Webservice. If the WebService throws an Exception my Client app always get's a SoapException instead of the "real" Exception. Here's a demo: [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] public class Service1 : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { throw new IndexOutOfRangeException("just a demo exception"); } } Now, on the client side, I want to be able to handle different exceptions in a different way. try { ServiceReference1.Service1SoapClient client = new ServiceReference1.Service1SoapClient(); Button1.Text = client.HelloWorld(); } catch (IndexOutOfRangeException ex) { // I know how to handle IndexOutOfRangeException // but this block is never reached } catch (MyOwnException ex) { // I know how to handle MyOwnException // but this block is never reached } catch (System.ServiceModel.FaultException ex) { // I always end in this block } But that does not work because I always get a "System.ServiceModel.FaultException" and I can only figure out the "real" exception by parsing the Exception's message property: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.IndexOutOfRangeException: just a demo\n at SoapExceptionTest.Service1.Service1.HelloWorld() in ... --- End of inner exception stack trace --- Is there a way to make this work somehow?

    Read the article

  • C# update GUI continuously from backgroundworker.

    - by Qrew
    I have created a GUI (winforms) and added a backgroundworker to run in a separate thread. The backgroundworker needs to update 2 labels continuously. The backgroundworker thread should start with button1 click and run forever. class EcuData { public int RPM { get; set; } public int MAP { get; set; } } private void button1_Click(object sender, EventArgs e) { EcuData data = new EcuData { RPM = 0, MAP = 0 }; BackWorker1.RunWorkerAsync(data); } private void BackWorker1_DoWork(object sender, DoWorkEventArgs e) { EcuData argumentData = e.Argument as EcuData; int x = 0; while (x<=10) { // // Code for reading in data from hardware. // argumentData.RPM = x; //x is for testing only! argumentData.MAP = x * 2; //x is for testing only! e.Result = argumentData; Thread.Sleep(100); x++; } private void BackWorker1_RunWorkerCompleted_1(object sender, RunWorkerCompletedEventArgs e) { EcuData data = e.Result as EcuData; label1.Text = data.RPM.ToString(); label2.Text = data.MAP.ToString(); } } The above code just updated the GUI when backgroundworker is done with his job, and that's not what I'm looking for.

    Read the article

  • NHibernate, Databinding to DataGridView, Lazy Loading, and Session managment - need advice

    - by Tom Bushell
    My main application form (WinForms) has a DataGridView, that uses DataBinding and Fluent NHibernate to display data from a SQLite database. This form is open for the entire time the application is running. For performance reasons, I set the convention DefaultLazy.Always() for all DB access. So far, the only way I've found to make this work is to keep a Session (let's call it MainSession) open all the time for the main form, so NHibernate can lazy load new data as the user navigates with the grid. Another part of the application can run in the background, and Save to the DB. Currently, (after considerable struggle), my approach is to call MainSession.Disconnect(), create a disposable Session for each Save, and MainSession.Reconnect() after finishing the Save. Otherwise SQLite will throw "The database file is locked" exceptions. This seems to be working well so far, but past experience has made me nervous about keeping a session open for a long time (I ran into performance problems when I tried to use a single session for both Saves and Loads - the cache filled up, and bogged down everything - see http://stackoverflow.com/questions/2526675/commit-is-very-slow-in-my-nhibernate-sqlite-project). So, my question - is this a good approach, or am I looking at problems down the road? If it's a bad approach, what are the alternatives? I've considered opening and closing my main session whenever the user navigates with the grid, but it's not obvious to me how I would do that - hook every event from the grid that could possibly cause a lazy load? I have the nagging feeling that trying to manage my own sessions this way is fundamentally the wrong approach, but it's not obvious what the right one is.

    Read the article

  • C# Convert Excel Range to Dataset or Datatable, etc.

    - by htbrady
    I have an Excel spreadsheet that will sit out on a network share drive. It needs to be accessed by my Winforms C# 3.0 application (many users could be using the app and hitting this spreadsheet at the same time). There is a lot of data on one worksheet. This data is broken out into areas that I have named as ranges. I need to be able to access these ranges individually, return each range as a dataset, and then bind it to a grid. I have found examples that use OLE and have got these to work. However, I have seen some warnings about using this method, plus at work we have been using Microsoft.Office.Interop.Excel as the standard thus far. I don't really want to stray from this unless I have to. Our users will be using Office 2003 on up as far as I know. I can get the range I need with the following code: MyDataRange = (Microsoft.Office.Interop.Excel.Range)MyWorkSheet.get_Range("MyExcelRange", Type.Missing); The OLE way was nice as it would take my first row and turn those into columns. My ranges (12 total) are for the most part different from each other in number of columns. Didn't know if this info would affect any recommendations. Is there any way to use Interop and get the returned range back into a dataset? Thanks for your help.

    Read the article

  • How do I connect to SDF on a Mobile device from desktop application?

    - by pitprog
    C# WinForms .Net 3.5 to SQL CE 3.5 on Mobile 6.1 Device I'd like to make a connection from a desktop application to a SDF database on my Windows Mobile device while it's connected via ActiveSync. Visual Studio lets me create a Data Connection to my device. The connections tests OK and I can view the data in the database using Visual Studio. I then create a form and try to fill a DataGridView. When I run the program I get an error that the path to the data base is not valid. How am I supposed to specify the Mobile device path in the connection string? In my App.Config, I've tried variations on the path, but none of them work: connectionString="Data Source=Mobile Device\Program Files\SqlCeViaActiveSync\Orders.sdf" connectionString="Data Source=\Mobile Device\Program Files\SqlCeViaActiveSync\Orders.sdf" connectionString="Data Source=Program Files\SqlCeViaActiveSync\Orders.sdf" connectionString="Data Source=\Program Files\SqlCeViaActiveSync\Orders.sdf" The full connection string section looks like this: <connectionStrings> <add name="SqlCeViaActiveSync.Properties.Settings.OrdersConnectionString" connectionString="Data Source=Mobile Device\Program Files\SqlCeViaActiveSync\Orders.sdf" providerName="Microsoft.SqlServerCe.Client.3.5" /> </connectionStrings> Also, I did make a reference to Microsoft.SqlServerCe.Client, as I found a few articles that mentioned it was necessary. Can anyone point me to some recent articles/samples or let me know what I'm doing wrong? Thanks!

    Read the article

  • Recursion in an ASP.NET MVC view

    - by Dennis Palmer
    I have a nested data object for a set of items within categories. Each category can contain sub categories and there is no set limit to the depth of sub categories. (A file system would have a similar structure.) It looks something like this: class category { public int id; public string name; public IQueryable<category> categories; public IQueryable<item> items; } class item { public int id; public string name; } I am passing a list of categories to my view as IQueryable<category>. I want to output the categories as a set of nested unordered list (<ul>) blocks. I could nest foreach loops, but then the depth of sub categories would be limited by the number of nested foreach blocks. In WinForms, I have done similar processing using recursion to populate a TreeView, but I haven't seen any examples of using recursion within an ASPX MVC view. Can recursion be done within an ASPX view? Are there other view engines that include recursion for view output?

    Read the article

  • Session State with MVP and Application Controller patterns

    - by Graham Bunce
    Hi, I've created an MVP (passive view) framework for development and decided to go for an Application Controller pattern to manage the navigation between views. This is targeted at WinForms, ASP.NET and WPF interfaces. Although I'm not 100% convinced that these view technologies really swappable, that's my aim at the moment so my MVP framework is quite lightweight. What I'm struggling to fit in is the concept of a "Business Conversation" that needs state information to be either (a) maintained for the lifetime of the View or, more likely, (b) maintained across several views for the lifetime of a use case (business conversation). I want state management to be part of the framework as I don't want developers to worry about it. All they need to do is to "start" a conversation, "Register" objects and the framework does the rest until the "end" a conversation. Has anybody got any thoughts (patterns) to how to fit this into MVP? I was thinking it may be part of the Application Controller responsibility (delegating to a Conversation Manager object) as it knows about current state in order to send the user to the next view.... but then I thought it may be up to the Presenter to start and end the conversation so then it comes down the presenters to manage conversations and the objects registered for the that conversation. Unfortunately that means presenters can't be used in different conversations... so that idea doesn't seem right. As you can see, I don't think there is an easy answer (and I've looked for a while). So anybody else got any thoughts?

    Read the article

  • .NET Reference "Copy Local" True / False Being Set Based on Contents of GAC

    - by D-Sect
    We had a very interesting problem with a Win Forms project. It's been resolved. We know what happened, but we want to understand why it happened. This may help other people out in the future who have a similar problem. The WinForms project failed on 2 of our client's PCs. The error was an obscure kernel.dll error. The project ran fine on 3 other PCs. We found that a .DLL (log4net.dll - a very popular open-source logging library) was missing from our release folder. It was previously in our release folder. Why was it missing in this latest release? It was missing because I must have installed a program on my Dev box that used log4net.dll and it was added to the Global Assembly Cache. When I checked the solution's references for log4net.dll, they were changed to "copy local=FALSE". They must have changed automatically because log4net.dll was present in my GAC. Here's where my question starts: Why did my reference for log4net.dll get changed from COPY LOCAL = TRUE to COPY LOCAL = FALSE? I suspect it's because it was added to my GAC by another program. How can we prevent this from happening again? As it stands now, if I install a piece of software that uses a common library and it adds it to my GAC, then my SLNs that reference that DLL will change from Copy Local TRUE to FALSE.

    Read the article

  • System Tray Popup Windows 7 Style

    - by Mason Blier
    Hey All, I want something like this: http://cybernetnews.com/wp-content/uploads/2008/10/windows-7-wireless.jpg This window is not resizable, and aligns itself above the system tray icon which it is related to. I have this: http://i.imgur.com/79FZi.png Which is resizeable, and it goes wherever it feels like. If you click the volume control in Win 7, it always pops up directly above the icon. This is ideal. I've found this reference which I think is trying to solve the same problem (can't tell though as the images are dead), http://stackoverflow.com/questions/2169006/create-a-system-tray-styled-box-in-winforms-c but I'm using WPF and I'm not sure how to get these Form objects they refer to from my Window object. This is the XAML declaration of my window atm, <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="WirelessControl.Window1" x:Name="Window" Title="Window1" Width="260" Height="370" mc:Ignorable="d" WindowStyle="None"></Window> I feel like based on how common this is in Windows that there must be a fairly easy way to do this. ResizeMode="NoResize" causes my window border to disappear, so that's no help. Thanks guys, I hope I was comprehensive enough.

    Read the article

  • Threading 101: What is a Dispatcher?

    - by Water Cooler v2
    Once upon a time, I remembered this stuff by heart. Over time, my understanding has diluted and I mean to refresh it. As I recall, any so called single threaded application has two threads: a) the primary thread that has a pointer to the main or DllMain entry points; and b) For applications that have some UI, a UI thread, a.k.a the secondary thread, on which the WndProc runs, i.e. the thread that executes the WndProc that recieves messages that Windows posts to it. In short, the thread that executes the Windows message loop. For UI apps, the primary thread is in a blocking state waiting for messages from Windows. When it recieves them, it queues them up and dispatches them to the message loop (WndProc) and the UI thread gets kick started. As per my understanding, the primary thread, which is in a blocking state, is this: C++ while(getmessage(/* args &msg, etc. */)) { translatemessage(&msg, 0, 0); dispatchmessage(&msg, 0, 0); } C# or VB.NET WinForms apps: Application.Run( new System.Windows.Forms() ); Is this what they call the Dispatcher? My questions are: a) Is my above understanding correct? b) What in the name of hell is the Dispatcher? c) Point me to a resource where I can get a better understanding of threads from a Windows/Win32 perspective and then tie it up with high level languages like C#. Petzold is sparing in his discussion on the subject in his epic work. Although I believe I have it somewhat right, a confirmation will be relieving.

    Read the article

  • C# Application Calling Powershell Script Issues

    - by Ben
    Hi, I have a C# Winforms application which is calling a simple powershell script using the following method: Process process = new Process(); process.StartInfo.FileName = @"powershell.exe"; process.StartInfo.Arguments = String.Format("-noexit \"C:\Develop\{1}\"", scriptName); process.Start(); The powershell script simply reads a registry key and outputs the subkeys. $items = get-childitem -literalPath hklm:\software foreach($item in $items) { Write-Host $item } The problem I have is that when I run the script from the C# application I get one set of results, but when I run the script standalone (from the powershell command line) I get a different set of results entirely. The results from running from the c# app are: HKEY_LOCAL_MACHINE\software\Adobe HKEY_LOCAL_MACHINE\software\Business Objects HKEY_LOCAL_MACHINE\software\Helios HKEY_LOCAL_MACHINE\software\InstallShield HKEY_LOCAL_MACHINE\software\Macrovision HKEY_LOCAL_MACHINE\software\Microsoft HKEY_LOCAL_MACHINE\software\MozillaPlugins HKEY_LOCAL_MACHINE\software\ODBC HKEY_LOCAL_MACHINE\software\Classes HKEY_LOCAL_MACHINE\software\Clients HKEY_LOCAL_MACHINE\software\Policies HKEY_LOCAL_MACHINE\software\RegisteredApplications PS C:\Develop\RnD\SiriusPatcher\Sirius.Patcher.UI\bin\Debug When run from the powershell command line I get: PS M: C:\Develop\RegistryAccess.ps1 HKEY_LOCAL_MACHINE\software\ATI Technologies HKEY_LOCAL_MACHINE\software\Classes HKEY_LOCAL_MACHINE\software\Clients HKEY_LOCAL_MACHINE\software\Equiniti HKEY_LOCAL_MACHINE\software\Microsoft HKEY_LOCAL_MACHINE\software\ODBC HKEY_LOCAL_MACHINE\software\Policies HKEY_LOCAL_MACHINE\software\RegisteredApplications HKEY_LOCAL_MACHINE\software\Wow6432Node PS M: The second set of results match what I have in the registry, but the first set of results (which came from the c# app) don't. Any help or pointers would be greatly apreciated :) Ben

    Read the article

  • .NET4: In-Process Side-by-Side Execution Explained

    - by emptyset
    Overview: I'm interested in learning more about the .NET4 "In-Process Side-by-Side Execution" of assemblies, and need additional information to help me demystify it. Motivation: The application in question is built against .NET2, and uses two third-party libraries that also work against .NET2. The application is deployed (via file copy) to client machines in a virtual environment that includes .NET2. Not my architecture, please bear with me. Goal: To see if it's possible to rebuild the application assemblies (or a subset) against .NET4, and ship the application as before, without changing the third-party libraries and including the .NET4 Client Profile (as described here) in the deployment. Steps Taken: The following articles were read, but didn't quite provide me enough information: In-Process Side-by-Side Execution: Browsed this article, and Scenario Two is the closest it comes to describing something that resembles my situation, but doesn't really cover it with any depth. ASP.NET Side-by-Side Execution Overview: This article covers a web application, but I'm dealing with a client WinForms application. CLR Team Blog: In-Process Side-by-Side: This is useful to explain how plug-ins to host processes function under .NET4, but I don't know if this applies to the third-party libraries. Further Steps: I'm also unclear on how to proceed upgrading a single .NET2 assembly to .NET4, with the overall application remaining in .NET2 (i.e. how to configure the solution/project files, if any special code needs to be included, etc.).

    Read the article

  • NHibernate Generators

    - by Dan
    What is the best tool for generating Entity Class and/or hbm files and/or sql script for NHibernate. This list below is from http://www.hibernate.org/365.html, which is the best any why? Moregen Free, Open Source (GPL) O/R Generator that can merge into existing Visual Studio Projects. Also merges changes to generated classes. NConstruct Lite Free tool for generating NHibernate O/R mapping source code. Different databases support (Microsoft SQL Server, Oracle, Access). GENNIT NHibernate Code Generator Free/Commercial Web 2.0 code generation of NHibernate code using WYSIWYG online UML designer. GenWise Studio with NHibernate Template Commercial product; Imports your existing database and generates all XML and Classes, including factories. It can also generate a asp.net web-application for your NHibernate BO-Layer automatically. HQL Analyzer and hbm.xml GUI Editor ObjectMapper by Mats Helander is a mapping GUI with NHibernate support MyGeneration is a template-based code generator GUI. Its template library includes templates for generating mapping files and classes from a database. AndroMDA is an open-source code generation framework that uses Model Driven Architecture (MDA) to transform UML models into deployable components. It supports generation of data access layers that use NHibernate as their persistence framework. CodeSmith Template for NH NHibernate Helper Kit is a VS2005 add-in to generate classes and mapping files. NConstruct - Intelligent Software Factory Commercial product; Full .NET C# source code generation for all tiers of the information system trough simple wizard procedure. O/R mapping based on NHibernate. For both WinForms and ASP.NET 2.0.

    Read the article

  • Explicit behavior with checks vs. implicit behavior

    - by Silviu
    I'm not sure how to construct the question but I'm interested to know what do you guys think of the following situations and which one would you prefer. We're working at a client-server application with winforms. And we have a control that has some fields automatically calculated upon filling another field. So we're having a field currency which when filled by the user would determine an automatic filling of another field, maybe more fields. When the user fills the currency field, a Currency object would be retrieved from a cache based on the string introduced by the user. If entered currency is not found in the cache a null reference is returned by the cache object. Further down when asking the application layer to compute the other fields based on the currency, given a null currency a null specific field would be returned. This way the default, implicit behavior is to clear all fields. Which is the expected behavior. What i would call the explicit implementation would be to verify that the Currency object is null in which case the depending fields are cleared explicitly. I think that the latter version is more clear, less error prone and more testable. But it implies a form of redundancy. The former version is not as clear and it implies a certain behavior from the application layer which is not expressed in the tests. Maybe in the lower layer tests but when the need arises to modify the lower layers, so that given a null currency something else should be returned, i don't think a test that says just that without a motivation is going to be an impediment for introducing a bug in upper layers. What do you guys think?

    Read the article

  • WPF Background Thread Invocation

    - by jeffn825
    Maybe I'm mis-remembering how Winforms works or I'm overcomplicating the hell out of this, but here's my problem. I have a WPF client app application that talks to a server over WCF. The current user may "log out" of the WPF client, which closes all open screens, leaves only the navigation pane, and minimizes the program window. When the user re-maximizes the program window, they are prompted to log in. Simple. But sometimes things happen on background threads - like every 5 minutes the client tries to make a WCF calls that refreshes some cached data. And what if the user is logged out when this 5 minute timer triggers? Well, then the user should be prompted to log back in...and this must of course happen on the UI thread. private static ISecurityContext securityContext; public static ISecurityContext SecurityContext { get { if (securityContext == null) { // Login method shows a window and prompts the user to log in Application.Current.Dispatcher.Invoke((Action)Login); } return securityContext; } } So far so good, right? But what happens when multiple threads hit this spot of code? Well, my first intuition was that since I'm syncrhonizing across the Application.Current.Dispatcher, I should be fine, and whichever thread hit first would be responsible for showing the login form and getting the user logged in... Not the case... Thread 1 will hit the code and call ShowDialog on the login form Thread 2 will also hit the code and will call Login as soon as Thread 1 has called ShowDialog, since calling ShowDialog unblocked Thread 1 (I believe because of the way the WPF message pump works) All I want is a synchronized way of getting the user logged back into the application...what am I missing here? Thanks in advance.

    Read the article

  • WPF Datagrid set the column values only when the row is left

    - by Noam
    Hello I have a simple class. When I use it in winforms binding, whenever I change a value of a cell and leave the cell, the property immediately get changed. Using WPF Datagrid, whenever i change a value of a cell, the property gets set only after I leave the row. That is problematic for me. What am I doing wrong? Here is my code: public class MyClass : IEditableObject, INotifyPropertyChanged { string _name, _lastName; public string Name { get { return _name; } set { _name = value; _lastName = value + " xxx"; OnPropertyChanged("LastName"); MessageBox.Show("Test"); } } private void OnPropertyChanged(string p) { var x = new PropertyChangedEventArgs(p); if (PropertyChanged != null) PropertyChanged(this, x); } public string LastName { get { return _lastName; } set { _lastName = value; } } public void BeginEdit() { } public void CancelEdit() { } public void EndEdit() { } public event PropertyChangedEventHandler PropertyChanged; } public class myBindingList : BindingList<MyClass> { public myBindingList() { AllowNew = true; Add(new MyClass { Name = "noam" }); Add(new MyClass { Name = "yael" }); } }

    Read the article

  • Debugger Visualizer, ElementHost, and Edit and Continue problems

    - by Frank Fella
    I recently wrote a custom Debugger Visualizer for Visual Studio 2008 for one of the custom types in my application. The UI for the visualizer is written in WPF and is hosted in an element host and shown using the IDialogVisualizerService windowService object. Everything works great, and my visualizer loads and shows the relevant information, but if try to "edit and continue" in my application after loading the visualizer, Visual Studio crashes with no useful error message. In trying to debug this I removed almost all of my code from the solution to the point where I was only serializing a string with the ObjectSource and displaying just an empty element host and I still get the crash on edit and continue. If I remove the element host and show a WinForms control or form there is no crash. Here is the Visualizer code: using System; using System.Drawing; using System.IO; using System.Runtime.Serialization.Formatters.Binary; using System.Windows.Forms; using System.Windows.Forms.Integration; using Microsoft.VisualStudio.DebuggerVisualizers; using ObjectVisualizerShared; using ObjectVisualizerUI; namespace ObjectVisualizer { public class Visualizer : DialogDebuggerVisualizer { protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { try { Stream stream = objectProvider.GetData(); if (stream.Length > 0) { BinaryFormatter formatter = new BinaryFormatter(); VisualizerNode node = (VisualizerNode)formatter.Deserialize(stream); if (node != null) { VisualizerWindow window = new VisualizerWindow(node); ElementHost host = new ElementHost(); host.Child = window; host.Dock = DockStyle.Fill; host.Size = new Size(800, 600); windowService.ShowDialog(host); } } } catch (Exception ex) { MessageBox.Show(string.Format("Error!\n{0}", ex), "Object Visualizer"); } } } } Any ideas?

    Read the article

  • USB Barcode Scanner and WM_KEYDOWN

    - by Bryce Fischer
    I am trying to write a program that can will read a barcode scanner. In addition, I need it to read the input even when the application is not the window in focus (i.e., running in system tray, etc). I found this article, titled Distinguishing Barcode Scanners from the Keyboard in WinForms, that seems to solve the exact problem. It is working pretty good, it detects my device and handles the WM_INPUT message. However, it is checking to see if the RAWINPUT.keyboard.Message is WM_KEYDOWN (0x100). It never seems to receive this. The only line of code I've altered in the code provided in the article is adding a Console.Out.WriteLine to output the actual values of that message: Console.Out.WriteLine("message: {0}", raw.keyboard.Message.ToString("X")); if (raw.keyboard.Message == NativeMethods.WM_KEYDOWN) { .... Here is what it outputs: message: B message: 1000B message: 3 message: 10003 message: 8 message: 10008 message: 3 message: 10003 message: 5 message: 10005 message: 3 message: 10003 message: 8 message: 10008 message: 8 message: 10008 message: 4 message: 10004 message: 9 message: 10009 message: 9 message: 10009 message: 3 message: 10003 The value I'm expecting to receive when this completes correctly is: 257232709 Which I verified by scanning to notepad. I don't know if the Operation System is relevant here, but I figured I should mention that I'm running this in Windows 7 64 and Visual Studio 2010 and .NET Framework 3.5. Scanner is a USB Barcode Scanner, Symbol LS2208, setup as "HID KEYBOARD EMULATION"

    Read the article

  • Worksheet.Unprotect - Office Interop - Difference between 2003 and 2007

    - by sdmcnitt
    I have a .NET winforms app that automates Excel and checks for a worksheet password. The requirements are to be able to detect 1) that the protection is turned off 2) that the password is removed (protected but there is no password) 3) that the password matches the correct password from a database To meet the second requirement the program calls the Worksheet.Unprotect command with a null string, capturing the error. If error as expected, the 3rd check is made. If no error, then the Unprotect worked without a password == password was removed. The code sample below has these checks. The application can do this fine with Office 2003. I have since had my dev machine updated to Office 2007 and it no longer works as it did. When I call the Worksheet.Unprotect, Excel prompts for the password! I need to know how this should be accomplished in the new version of Excel or if there is a way to reference the old PIA. No matter what if I set a reference to Excel 11 it is replaced with the PIA for 12 in the GAC. 'return true if unprotect of worksheet does not generate an error 'all other errors will bubble up 'return false if specific error is "Password is invalid..." Try 'detect unprotected or no password If oWorksheet.ProtectContents Then 'try with no passsword and expect an error 'if no error then raise exception Dim blnRaiseException As Boolean = True Try 'oWorksheet.Unprotect(vbNullString) oWorksheet.Unprotect() Catch ex As Exception blnRaiseException = False End Try If blnRaiseException Then Throw New ExcelSheetNoPasswordException End If oWorksheet.Unprotect(strPwd) 'no error so if we get here -- success fnCheckWorksheetPwd = True 'leave as it was -- this may still cause workbook to think it is changed oWorksheet.Protect(strPwd) Else Throw New ExcelSheetNotProtectedException End If Catch COMex As System.Runtime.InteropServices.COMException 'handle error code -2146827284 If COMex.ErrorCode = -2146827284 Then 'this is the error we're looking for Else Throw End If Catch ex As Exception Throw End Try

    Read the article

  • SQL Compact error: Unable to load DLL 'sqlceme35.dll'. The specified module could not be found

    - by Ciaran Bruen
    Hi - I'm developing a Winforms application using Visual Studio 2008 C# that uses a SQL compact 3.5 database on the client. The client will most likely be 32 bit XP or Vista machines. I'm using a standard Windows Installer project that creates an msi file and setup.exe to install the app on a client machine. I'm new to SQL compact so I haven't had to distribute a client database like this before now. When I run the setup.exe (on new Windows XP 32 bit with SP2 and IE 7) it installs fine but when I run the app I get the error below: Unable to load DLL 'sqlceme35.dll'. The specified module could not be found I spent a few hours searching this error already but all I can find are issues relating to installing on 64 bit Windows, none relating to normal 32 bit that I'm using. The install app copies the all the dependant files that it found into the specified install directory, including the System.Data.SqlServerCe.dll file (assembly version 3.5.1.0). The database file is in a directory called 'data' off the application directory, and the connection string for it is <add name="Tickets.ieOutlet.Properties.Settings.TicketsLocalConnectionString" connectionString="Data Source=|DataDirectory|\data\TicketsLocal.sdf" providerName="Microsoft.SqlServerCe.Client.3.5" /> Some questions I have: should the app be able to find the dll if it's in the same directory i.e. local to the app, or do I need to install it in the GAC? (If so cam I use the Windows Installer to install a dll in the GAC?) is there anything else I need to distribute with the app in order to use a Sql Compact database? there are other dlls also such as MS interop for exporting data to Excel on the client. Do these need to be installed in the GAC or will locating them in the application directory suffice? TIA, Ciaran.

    Read the article

  • .NET Reference "Copy Local" True / Fasle Being Set Based on Contents of General Assembly

    - by D-Sect
    Hello All. First question for me here. We had a very interesting problem with a Win Forms project. It's been resolved. We know what happened, but we want to understand why it happened. This may help other people out in the future who have a similar problem. The WinForms project failed on 2 of our client's PCs. The error was an obscure kernel.dll error. The project ran fine on 3 other PCs. We found that a .DLL (log4net.dll - a very popular open-source logging library) was missing from our release folder. It was previously in our release folder. Why was it missing in this latest release? It was missing because I must have installed a program on my Dev box that used log4net.dll and it was added to the general assembly. When I checked the SLN's references for log4net.dll, they were changed to "copy local=FALSE". They must have changed automagicially because log4net.dll was present in my GAC. Here's where my question starts: Why did my reference for log4net.dll get changed from COPY LOCAL = TRUE to COPY LOCAL = FALSE? I suspect it's because it was added to my GAC by another program. How can we prevent this from happening again? As it stands now, if I install a piece of software that uses a common library and it adds it to my GAC, then my SLNs that REF that DLL will change from Copy Local TRUE to FALSE. Thank you so much. I hope this helps people out who have a piece of software that runs in some places, but not in others, when it used to run fine in ALL places.

    Read the article

  • Pattern for sharing data between views (MVP or MVVM)

    - by Dovix
    What is a good pattern for sharing data between related views?. I have an application where 1 form contains many small views, each views behaves independently from each other more or less (they communicate/interact via an event bus). Every so often I need to pass the same objects to the child views. Sometimes I need this same object to be passed to a child view and then the child passes it onto another child itself contains. What is a good approach to sharing this data between all the views contained within the parent form (view) ? I have looked into CAB and their approach and every "view" has a "root work item" this work item has dictionary that contains a shared "state" between the views that are contained. Is this the best approach? just a shared dictionary all the views under a root view can access? My current approach right now is to have a function on the view that allows one to set the object for that view. Something like view.SetCustomer(Customer c); then if the view contains a child view it knows to set it on the child view ala: this.childview1.SetCustomer(c); The application is written in C# 3.5, for winforms using MVP with structure map as a IoC/DI provider.

    Read the article

  • Implementing BindingList<T>

    - by EtherealMonkey
    I am trying to learn more about BindingList because I believe that it will help me with a project that I am working on. Currently, I have an object class (ScannedImage) that is a subtype of a class (HashedImage) that subtypes a native .Net object (Image). There is no reason why I couldn't move the two subtypes together. I am simply subtyping an object that I had previously constructed, but I will now be storing my ScannedImage object in an RDB (well, not technically - only the details and probably the thumbnail). Also, the object class has member types that are my own custom types (Keywords). I am using a custom datagridview to present these objects, but am handling all changes to the ScannedImage object with my own code. As you can probably imagine, I have quite a few events to handle that occur in these base types. So, if I changed my object to implement INotifyPropertyChanged, would the object collection (implementing BindingList) receive notifications of changes to the ScannedImage object? Also, if Keywords were to implement INotifyPropertyChanged, would changes be accessible to the BindingList through the ScannedImage object? Sorry if this seems rather newbish. I only recently discovered the BindingList and not having formal training in C# programming - am having a difficult time moving forward with this. Also, if anyone has any good reference material, I would be thankful for links. Obviously, I have perused the MSDN Library. I have found a few good links on the web, but it seems that a lot of people are now using WPF and ObservableCollection. My project is based on Winforms and .Net3.5 framework. TIA

    Read the article

  • Looking for a .Net ORM

    - by SLaks
    I'm looking for a .Net 3.5 ORM framework with a rather unusual set of requirements: I need to create and alter tables at runtime with schemas defined by my end-users. (Obviously, that wouldn't be strongly-typed; I'm looking for something like a DataTable there) I also want regular strongly-typed partial classes for rows in non-dynamic tables, with custom validation and other logic. (Like normal ORMs) I want to load the entire database (or some entire tables) once, and keep it in memory throughout the life of the (WinForms) GUI. (I have a shared SQL Server with a relatively slow connection) I also want regular LINQ support (like LINQ-to-SQL) for ASP.Net on the shared server (which has a fast connection to SQL Server) In addition to SQL Server, I also want to be able to use a single-file database that would support XCopy deployment (without installing SQL CE on the end-user's machine). (Probably Access or SQLite) Finally, it has to be free (unless it's OpenAccess) I'll probably have to write it myself, as I don't think there is an existing ORM that meets these requirements. However, I don't want to re-invent the wheel if there is one, hence this question. I'm using VS2010, but I don't know when my webhost (LFC) will upgrade to .Net 4.0

    Read the article

< Previous Page | 101 102 103 104 105 106 107 108 109 110 111 112  | Next Page >