.net

How to check if two objects inherit from the same base class?

I'm trying to override Object::Equals in C++ .NET but I'm running into some difficulties virtual bool IState::Equals(Object^ o) override{ if (o->GetType() == IState::typeid){ IState^ s = (IState^) o; if (s->type == this->type && s->target_state == this->target_state && s->current_state == this->current_sta...

how to start a remote process with command line arguments?

I was playing around with WMI to try to get this to work, but I've had 3 issues. 1: Anything I start doesn't show up with an application window on the remote system. 2: Most of the system's I've tried i'm getting access denied messages on. 3: How do I pass command line arguments O_O. ...

How does one add a LinkedList<T> to a LinkedList<T> in C#?

One would think the simple code llist1.Last.Next = llist2.First; llist2.First.Previous = llist1.Last; would work, however apparently in C#'s LinkedList, First, Last, and their properties are Get only. The other method I could think of was llist1.AddLast(llist2.First); However, this does not work either - it fails because the first...

What is a .NET application domain?

In particular, what are the implications of running code in two different application domains? How is data normally passed across the application domain boundary? Is it the same as passing data across the process boundary? I'm curious to know more about this abstraction and what it is useful for. EDIT: Good existing coverage of the Ap...

VB Getting Object from DataGridView Row

First off, I found a similar question here, but don't understand how it works, and I'm not comfortable 'bumping' or replying to a couple month old question. I have a datagridview control and it's DataSource property is set to a List type object. Question: I'm trying to figure out how to reference the actual object of a selected row so ...

DataAdapter.Fill() behavior for row deleted at the data source

I'm using the DataSet/DataTable/DataAdapter architecture to mediate between the database and my model objects, which have their own backing (they aren't backed by a DataRow). I've got a DataAdapter with AcceptChangesDuringFill = False, AcceptChangesDuringUpdate = False, and FillLoadOption = OverwriteChanges. Here's my understanding of th...

Generate entity class from database table

I need to build a class in this form namespace BestCompanyEver { public class PersonInfo { public string Name{get;set;} public int Age{get;set;} } } From a table Person that has columns Name and Age. Are there any ready to use solutions for this? I know I can implement this with T4 or Codesmith, but there shou...

MDI Child form calling, not generation.

Hello. I have an MDI form with 3 nested children with in it. As of right now all it can do is display a new form. For example: each time I press the menu button, the new child form(Form1) is created. Now, if I press that same menu button a second or subsequent time a new Form1 is created and it appears over the previous one. What I w...

Class library with service references

Hi! I have a class library (.NET) with a reference to a web service (in some server, not a project in the same solution). The class library has a class that is exposed to COM. This class invokes the web service. When I add the service reference, this adds code to the class library's app.config. I also have a desktop application in the...

Why can't I step into this line?

Math.Sign(int.MaxValue); I hit F11 to step into it and it steps right over it. I have all the options set for debugging .NET framework source (I think). Edit: for someone with Visual Studio 2008 SP1 and .NET 3.5 SP1 who can step into this line successfully: what is the size of your .pdb file? Edit 2: because I can successfully step i...

Simple LINQ query

I have a collection like this List<int> {1,15,17,8,3}; how to get a flat string like "1-15-17-8-3" through LINQ query? thank you ...

WeakReference implementation in .NET

I understand and appreciate the usefulness of the System.WeakReference class in the .NET framework, but am curious as to the implementation details. How is WeakReference implemented in .NET? MSDN discusses the usage of WeakReference in detail, but has little details that I've seen on how this works under the hood. How does the CLR t...

What are the differences between .NET in 32 or 64 bit systems?

Imagine a pure .NET application which do not uses COM components nor PInvoke. Does it matters if the target system is 32 or 64 bits? ...

Service In Perpetual "Starting" Status

I've written a windows service in C# that converts wav files into mp3 and then stores them on a remote server. On my development rig (OS: WinXP SP3) the service starts up fine and runs the way it's supposed to. When I installed it the production machine (OS: WinServer 2000), upon starting the service it fails to start in a timely fashio...

How to extract all fields from create sql statment using .Net?

I am creating a windows application using VB.Net and this application will take a SQl create .sql file as a parameter and will return all fields and their data types inside in a list or array. Example: USE [MyDB] GO /****** Object: Table [dbo].[User] Script Date: 07/07/2009 10:16:48 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFI...

Looking for a .Net disk-buffered stream

I have an .NET 2.0 web application that is only used as the back-end for a client application that will send it a request with 1-500KB of data, and the server will do some processing on that data, then query a database to build a set of data to return the client -- anywhere from 200KB to 200MB of data. The data may take up to 15 minutes...

Giving a property the same name as its class

I've sometimes seen code written like this : public class B1 { } public class B2 { private B1 b1; public B1 B1 { get { return b1; } set { b1 = value; } } } i.e. class B2 has a property named "B1", which is also of type "B1". My gut instinct tells me this is not a good idea, but are there any technical reasons why you shoul...

x264 process stops working no matter on anything

Hi, i have made my video encoder. well very simple one and my process stops working after it gets to certain percent. Is there anything i could do to make it work? Is there some memory limitation? Could i run it somehow different? ...

Object Not Garbage Collected

Hello All, I have a third party component I'm using and I'm seeing some issues with resources not being released. The component causes windows to create a handle to a UDP socket ("\Device\Udp" as well as "\Device\Afd"). If I allow the program to execute and dereference the third party object, I assumed that like all .NET objects I've ...

How can we get Microsoft to maintain the .Net reference source?

A year and a half ago, Microsoft released the source code for the .Net Framework BCL for debugging purposes. This incredibly useful offering has had a tremendous impact on my debugging experience. It was mentioned that they were working integrating the source release into their build process, but this appears to have fallen through. T...