.net

Can you call a C# DLL from a C DLL?

I've built a DLL in C#. Now I want to use the R Environment to call functions in that DLL. The R environment supports calling unmanaged C/C++ DLL's but not into .NET DLL's. So my question is, can I call functions in a C# DLL from a C/C++ DLL? If so, do you have a link to info about how to do this? ...

ASP.NET CustomValidator client side

I can't get this CustomValidator working. In the <head>: <script language="javascript" type="text/javascript"> function ValidateFile(sender, args){ alert("Hi"); args.IsValid = document.getElementById("fuFile").value != "" || document.getElementById("c101_c7").value != ""; } </script> In the body...

Operator Overloading with Interface-Based Programming in C#

Background I am using interface-based programming on a current project and have run into a problem when overloading operators (specifically the Equality and Inequality operators). Assumptions I'm using C# 3.0, .NET 3.5 and Visual Studio 2008 UPDATE - The Following Assumption was False! Requiring all comparisons to use Equals ra...

Problem displaying live image from camera

I am developing a C# .NET application which will display the image captured from a camera (smart camera). I am using the function below to convert the raw data received from the camera (which is a byte array) to a bitmap image. The problem I face with the below code is that, the image displayed in the C# .NET application's picture box (w...

Keyboard Mapping in .NET

If I know that a certain key has been pressed (eg Key.D3), and that the Shift key is also down (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift)), how can I find out what character that refers to (eg, '#' on US keyboard, UK pound sign on UK keyboard, etc)? Put another way, how can I find out, programatically, that...

Erratic Invalid Viewstate issue in a .NET application

I seem to be getting a "invalid viewstate" every now and then in the event viewer for my ASP.NET application. Most of them (95%) seem to be referencing ScriptResource.axd (the application uses the ASP.NET AJAX library). There is no way I can remove the Ajax library either as Ajax is used everywhere.. How can I reduce these errors? I'...

Spring.NET & Constructor Interceptors

I'm trying to do some AOP over objects at construction time, and found IConstructorInterceptor, which would be perfect for what I want but it doesn't appear to work (in version 1.2 at least). I've also looked at both the IObjectPostProcessor & the IInstantiationAwareObjectPostProcessor, but I can't find any way to do processing on an ob...

Windows Mobile Development: Choice of .Net compact vs. Native (c++) code

Hey there, I work on an experienced and diverse development team and we are preparing to approach our first mobile development which will be for Windows Mobile 6 (platform changes are not an option). We have skills and experience in both Visual C++ and .Net technologies for Windows desktop and server development. The mobile developm...

What is faster- Java or C# (Or good old C)?

I'm currently deciding on a platform to build a scientific computational product on, and am deciding on either C#, Java, or plain C with Intels compiler on Core2 Quad CPU's. It's mostly integer arithmetic. My benchmarks so far show Java and C are about on par with each other, and dotNET/C# trails by about 5%- however a number of my cow...

Simplest way to write and read date from filename in .net

With the limitations that a filename provides, what is the simplest way to write a datetime into a filename and then read it back into a datetime in .net? ...

Child collection not filtering even though linq to sql join exists

I have a LINQ query: var result = from mt in MessageTypes join mtfmt in MessageTypeField_MessageTypes on new { MessageTypeID = mt.ID, MessageTypeFieldID = messageTypeFieldId } equals new { MessageTypeID = mtfmt.MessageTypeID, MessageTypeFieldID = mtfmt.MessageTypeFieldID } where (mt.StatusID == (int)status) sele...

Searching for a component in NET 3.5

Hello, I'm searching for a component similiar to this one(Delphi) in .NET 3.5 SP1 Thanks. ...

Override .NET Generic List<MyType>.Contains(MyTypeInstance)?

Is it possible, and if so how do I override the Contains method of an otherwise normal List<T>, where T is my own, custom type? ...

OCR .NET Recommended

hi i have just tried a component for OCR in .NET and the results were pretty inacurrate. has anybody else been down this route before? can you please recommend a path for me to save me the time of evaluating lots of components that produce not satisfactory results. any recommendations much appreciated. i dont mind buying in or coding my...

C#: How to add subitems in ListView

Creating an item(Under the key) is easy,but how to add subitems(Value)? listView1.Columns.Add("Key"); listView1.Columns.Add("Value"); listView1.Items.Add("sdasdasdasd"); //How to add "asdasdasd" under value? ...

Do .NET Timers Run Asynchronously?

I have a messaging aspect of my application using Jabber-net (an XMPP library.) What I would like to do, if for some reason the connection to the Server is ended, is keep trying to connect every minute or so. If I start a Timer to wait for a period of time before the next attempt, does that timer run asynchronously and the resulting Ti...

Foreach fails with a marshalled COM interface

We have a 32-bit COM component written with ATL in C++. When there's a need to use it from 64-bit .NET, we create a COM+ application and everything works allright. Recently we noticed strange behaviour on Win2k8. The COM object in our component fires an event and we process it in .NET code. The event has a parameter also passed from the...

Scenarios where Xml Serialization fail in .NET

I would like to know the most common scenarios where xml serialization may fail in .NET. ...

Error creating System.Type from string "System.Int32"

On a web site I published (pre-compiled) last night, I get the following error. Before pre-compiling it, I was getting a compiler error that a User Control was not found. After compiling on another machine, and running, I get the following Parser error: "Cannot create an object of type 'System.Type' from its srting representation 'Syste...

multiple instances of named argument in list

Hi, I have a problem executing oracle procedures from Visual Studio 2008's Server Explorer, when i try to execute a procedure all the input parameters are doubled! it only happend to me in one workstation, i've tried to reinstall oracle products, but it doesn't helped me... i get the following error message when i try execute the pro...