invalidoperationexception

Use of NativeWindow for ComboBox causes exception in Dispose-method

醉酒当歌 提交于 2019-12-24 00:20:09
问题 In C# Windows.Forms I want to intercept the paste-windowmessage for a combobox. As this doesn't work by overriding the WndProc-method of the combobox, because I would need to override the WndProc of the textbox inside the combobox, I decided to create a custom class of type NativeWindow which overrides the WndProc. I assign the handle and release it, when the combobox-handle gets destroyed. But when Dispose for the combobox is called the problem is that I get an InvalidOperationException

WPF DependencyObject calling thread exception

拥有回忆 提交于 2019-12-20 03:12:53
问题 I have the following code which creates a temporary folder and uses a FileSystemWatcher to poll for files added to the folder on the Location property, and add them to a list: Scratchdisk.cs on Pastebin. The idea is to create a Scratchdisk object, and have FFmpeg extract video frames into it, the FileSystemWatcher builds a list of these files as FFmpeg creates them, and the list is presented as a DependencyObject that my UI binds to. I'm binding to the Scratchdisk object like so:

DataGrid 'EditItem' is not allowed for this view when dragging multiple items

匆匆过客 提交于 2019-12-19 02:28:56
问题 I have a datagrid which gets data like this: public struct MyData { public string name { set; get; } public string artist { set; get; } public string location { set; get; } } DataGridTextColumn col1 = new DataGridTextColumn(); col4.Binding = new Binding("name"); dataGrid1.Columns.Add(col1); dataGrid1.Items.Add((new MyData() { name = "Song1", artist = "MyName", location = "loc"})); dataGrid1.Items.Add((new MyData() { name = "Song2", artist = "MyName", location = "loc2"})); The problem is-

C# console application Invalid Operation Exception

无人久伴 提交于 2019-12-18 04:12:40
问题 using System; using System.Collections.Generic; using System.Text; using System.Data.Sql; using System.Data.SqlClient; namespace BissUpdater { class Program { static void Main(string[] args) { string connectionString = "Data Source=H....; Initial Catalog=LANDesk; Persist Security Info=True; User ID=Mainstc; Password=xxxxxxxx"; SqlConnection con = new SqlConnection(connectionString); con.Open(); } } } The SQL Connection threw a invalid operation exception. "Invalid Operation. The connection is

Windows Application has stopped working :: Event Name CLR20r3

女生的网名这么多〃 提交于 2019-12-17 20:17:07
问题 I developed an applicatin using Visual Studio.Net 2008 Team System with Infragistics Net Advantage Tools 2010.3 and made a Setup Exe file for my application and installed on client machines where they have both Windows7 32 bit and WindowsXP Service Pack 2. ( I have also tried both way by Setup Property TargetPlatform x86 and x64) But when i install and run this application (exe) file in development machine its installed and run correctly. Only on Client's machine its installed correctly but

ASP.NET Web Method that accepts a List<CustomObject> is failing with “Web Service method name is not valid.”

假装没事ソ 提交于 2019-12-17 19:28:32
问题 I want to create a web method that accepts a List of custom objects (passed in via jQuery/JSON). When I run the website locally everything seems to work. jQuery and ASP.NET and everyone is happy. But when I put it on one of our servers it blows up. jQuery gets a 500 error after the ajax request with the response being: System.InvalidOperationException: EditCustomObjects Web Service method name is not valid. Here's the web service method: [WebMethod] public void EditCustomObjects(int ID, List

How to debug System.InvalidOperationException in System.Security.AccessControl.Privilege.Revert()

无人久伴 提交于 2019-12-14 03:57:26
问题 I have an application that suddenly started crashing when it is shutting down with the following error in the Event Log: Application: App.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.InvalidOperationException Stack: at System.Security.AccessControl.Privilege.Revert() at System.Security.AccessControl.Privilege.Finalize() I did some digging in the .NET reference source for that method and it appears to be the

Invalid Operation Exception from C# Process Class

ぃ、小莉子 提交于 2019-12-14 00:16:25
问题 When I use VSTS debugger to see the properties of instance of class Process , many of the properties are marked with InvalidOperationException . Why? Am I doing anything wrong? I am using VSTS 2008 + C# + .Net 2.0 to develop a console application. Here is my code: System.Diagnostics.Process myProcess = new System.Diagnostics.Process(); myProcess.StartInfo.FileName = "IExplore.exe"; myProcess.StartInfo.Arguments = @"www.google.com"; myProcess.StartInfo.Verb = "runas"; myProcess.Start(); And a

Connection pool – one process – many threads

元气小坏坏 提交于 2019-12-13 16:37:10
问题 My understanding of the connection pool is; if the connectionstring is the exact same, then we reuse the connection instead of make a new connection. My problem is that I’m creating many threads for parallel processing. In this “dummy” program, I create 500 threads and let the ThreadPool function handle the threads. The steps are: Each thread make an update table in SQL. (Stating the timestamp for the update) Then the thread sleeps between 1 to 10 sec (random). At the end the thread makes

Page can have only Frame as parent and not Window

吃可爱长大的小学妹 提交于 2019-12-13 04:53:41
问题 Continuing on this question: Null reference error in App.xaml MVVM light, I'm making a WPF application and I'll add a Page -element on my Window . For this I'm using next code: <Window x:Class="Porject.MainWindow" 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" xmlns:local="clr-namespace