.net

Is it possible to make a call to a C# application from a C++ application?

Hi, I'm a programming student, and I've now had two classes in C#, this semester I'm taking my first C++ class. Out of curiosity, is it possible to call a C# application from a C++ application? If so, is it also possible to check if the computer running the program has the .NET framework? I'm just curious, and I think if its possib...

What's the difference between managed C++ and C#?

The major advantage I see for using C++ instead of C# is compiling to native code, so we get better performance. C# is easier, but compiles to managed code. Why would anyone use managed C++ for? What advantages it gives us? ...

.NET 4.0 Release Candidate

I just came across this article about WPF performance on Touch/Tablet devices. In the article, the .NET Framework release candidate is mentioned as a way to test if this issue is affecting your application. I'm only aware of the .NET Framework 4.0 Beta 2; is there a RC build of .NET Framework 4 available somewhere? Perhaps he just mean...

Sharing open source .net libraries

Let's say I've written SuperTest on top of nUnit 2.1 and I'd like to share my creation with the world. Jess would love to use my library and she also wants to use nUnit directly as well. Her app HeadBook uses nUnit 2.8 The scenarios I can see for a source release: She checks out the SuperTest source which ships with nUnit 2.1, copies ...

What are all the possible downsides of not closing a datareader in .Net framework?

I am looking for a comprehensive analysis on the side effects of not closing it. Example: Effect on connection pooling, memory, etc., ...

Standard business logic data classes for .NET

There are a lot of "primitive" boiler plate types of data classes that could appear in many different programs. However, I have never seen a class or library set that recognizes the need to combine all these things with common logic required for them such as validation. Example classes ([] brackets correspond to classes also in hypothe...

How Do I Describe 'Less Than Simple' Behavior (BDD) in Code?

Suppose that I am intending to draw some user-supplied text on a bitmap in C#, what sort of tests would I write up front? Is this sort of thing even possible? BDD seems very straight-forward when dealing with mathematical problems but I find it near impossible and more trouble than it's worth when dealing with custom UI controls, graph...

HTTP/.NET: How do I post some data and then work within that session?

I need to download a bunch of HTML pages programatically, but they are behind a login. SO what I need... I think... is to do the following. Use an HTTP POST to upload some form data including the username/password. Capture the session somehow. Cookies? Send a series of HTTP GETs to download the pages I need. #3 is easy, I do it all t...

32 bit ActiveX Control in a 64 bit .NET App

I'm creating a C#.Net application which I want to be able to compile for "All CPUs". I also want to include a specific ActiveX control in the UI of this app, but the ActiveX control I'm trying to use does not support 32 bit. Is there some trick or work around I can use to use get this control to work? What about embedding the ActiveX c...

best approach for Logging/Error Handling framework for a C# .NET v3.5 application? (enterprise library / log4net / ?)

Hi, I'm working on a .NET v3.5 winforms app and would like to leverage some support for: a) logging (to file & to perhaps windows events) b) error handling / exception handling framework - to assist in distinguishing messages that can be shown to user versus handled within the code and logged c) a bonus extra would be how to capture/...

Find the Label for a Targeted UIElement in WPF

Hello, I have the following XAML: <StackPanel> <Label Target="{Binding ElementName=txtSearch}" Content="_Search:" /> <TextBox x:Name="txtSearch" /> </StackPanel> I have an extension method that accepts a UIElement parameter like so: static public class MyExtensionMethods { static public string GetLabelText(this UIElement...

how to dynamically add combobox in windows forms(C#) and bound it to a column of a table in sql database

My windows form has an ADD button which adds a combo box to the form after each click. The problem is, i am not able to bind it to a table column at run time. Using an existing databinding source selects the same value in all the combo boxes. I am coding in C# here is the sample code ComboBox ocbNext = new ComboBox(); //HAVE set the r...

Most flexibilities rule engine for .NET

My upcoming project is relate to sales system, so one of the main requirement is "user can modify promotion by themselves". Promotions is vary, they give me some of them. Buy 1 get 1 free, Buy 2 get 3. One for 30%, two for 50%, three for 80% Buy product A will discount 30% for product B 20% off for more than 20$ per transaction I kno...

Are classes boxed? .NET

I was wondering, does a class get boxed? I always assumed every class had a virtual table which can be used to identify the class, so does it need to be boxed? ...

How to test methods that call other methods in a domain object

When working with Domain Objects, how do you typically unit test a method that calls another method in the object? For example: public class Invoice { public IList<InvoiceLine> InvoiceLines; public string Company; public bool IsDiscounted; public DateTime InvoiceDate; //... public GetTotalAmt(); public GetExtendedTotalAmt...

How can one measure the SOLIDness of C# code?

Which metrics are there and which tools exist to measure the SOLIDness of C# code? Or tools to indicate where the principles are violated most harmfully? ...

Can we make a enum as a generic data type?

Can we make a enum as a generic data type? If so please provide an example. Thanks in advance. ...

.NET does not search in PATH for my C# DLL

Hi, I have a C# dll say dll1 that is referenced by another C# dll say dll2 . The path to dll1 is specified in the env variable PATH. when I try to compile dll2 , the dll2 reports error that it could not find the assembly dll1. I am not sure how I can make this happen I thought PATH was used in Dll search by .Net. Awaiting some helpful...

SignedXml.CheckSignature Performance Issue

I have an issue with checking the signature of an XML file using .NET 3.5. It all works fine, but randomly the performance is poor. Sometimes it's instant and yet at other times it can take maybe 10 or 15 seconds to return. I've checked the machine and nothing is going on to affect it's overall performance, and it's the same on differen...

Group By either column using C# LINQ

I have a set of Data with columns such as below OffName,RO1,RO2,RO3 To explain further i use sample data as below: OffName RO1 RO2 RO3 A John Jack Rob B Earl John Carl C Rob Chris Kenny D Rodney Carl Jacob RO stands for Reporting Officer. Each Officer reports to upto 3 RO's.i need to make...