.net

In Visual Studio, how to correctly build an application for 64-bit machines?

I need to build an application for 64-bit platform to utilizes some DLL's built for 64-bit machines. I know how to you can build each project separately to target for 64-bit platform. But when you have many projects in one Visual Studio solution, and some DLL's are dependent of the others. How do you decide what projects to build as x64,...

Why can't you use GetType when casting?

I asked a still unanswered question that will shed more light on this question. Why can't I do this... _wizardDialog.UIRoot.Controls.Clear() _wizardDialog.UIRoot.Controls.Add(TryCast(wizardUserControl, wizardUserControl.GetType)) Why does using GetType in this way fail. The argument for try cast are object and type. Since wizardUse...

Creating a plugin for outlook with VS 2008

I've created an outlook add-in using Visual Studio 2008. What I want to do is add a menu item to the right click context menu of an email item. Does anyone have a sample or two of how to do this? ...

How do I share the appsettings among various AppDomains in .NET

I would like to share my AppSettings from Application.exe.config to be shared/used by the newly created AppDomains . I am creating AppDomains as shown below public static AppDomain Create(Guid sessionId) { AppDomain currentDomain = AppDomain.CurrentDomain; AppDomainSetup setup = new AppDomainSetup(); // use the ID a...

What are the benefits of implicit typing in C# 3.0 >+

The only advantage I can see to do: var s = new ClassA(); over ClassA s = new ClassA(); Is that later if you decide you want ClassB, you only have to change the RHS of the declaration. I guess if you are enumerating through a collection you can also just to 'var' and then figure out the type later. Is that it?? Is there some othe...

Does .NET have thread safe generic classes?

I have implemented my own RingBuffer, but I'm surprised to see that .NET does not have one. Or even a simply thread safe queue, list or collection? Why doesn't .NET contain thread safe classes? Are they planned for the future? ...

Getting a notification when my system freezes...

I have a minor problem where my (new) computer tends to completely freeze up. Am not sure when it happens exactly but the 6 times that it did happen during the last 4 weeks, it could have been related to a very long rendering task that eats up lots of RAM. (Am actually pretty sure that this rendering engine is causing this problem.) Anyw...

tool to trace application without code changes?

I've inherited a rather large WPF application, and I need to generate application traces for a significant portion of it. Because of the complexity of the project, I'd like to do this without making any changes to the code base, if possible. I mostly need to know the stack deltas, ie when a function call or return takes place. Is ther...

Passing an unmanaged C++ structure by reference to a managed C++ method causes an access violation when the structure is referenced

I'm trying to pass this structure: #pragma unmanaged typedef struct { void* data; unsigned nlen; unsigned int type; } PARAMETER; To this class static method: #pragma managed private class __gc GlobalFunctions { static void WriteField(Object* object, PARAMTER& par, unsigned dec) { switch (par.type) { ...

Fastest way to load an XML crypto stream into a Datatable

I currently have an XML file that is encrypted that I decrypt and put into a crypto stream. I then pass that to a method that uses the DataTable.readxml. The readxml() method takes 5-6 seconds but I'm hoping to get it down to 3-4 seconds. (or less) There are ~90k entries. I then use the DataTable for parsing data which eventually mak...

Entering text into a textbox that doesn't belong to your application (C#/.NET)

So, I was just wondering how I could enter text into a text box on a web page with a windows application. Almost like a reverse screen scrape. I know I have read somewhere about being able to do this but, I completely forgot how he did it. I think he may have been using Win32 DLLs which might be a fun endeavor but, getting off-topic n...

Managed access to microphone input and system volume

I am looking to do three things: Access data from the microphone. Really all I want to know is the overall volume of the sound sensed by the device. Set the microphone gain. Set the system volume. All of my windows dev experience is C#/WPF, so I'd like to stay managed. I do not need exceptionally high performance or realtime processi...

Entity Framework with a game server

I have been looking into using the Entity Framework in my C# game server to make querying easier. I am a huge fan of type safety, and the Entity Framework does a great job at automating most of the boilerplate code. Though I am not quite sure how to go about utilizing some of the components, namely the ObjectContext. The server uses qui...

More Information about integrating a database into my C# Winforms Application?

I've used databases in asp.net but I now have a situation where I need the power/flexibility of a database but I need to ship it with my application. I need to access my tables and create new ones etc but without requiring the user to have any kind of database software installed. I.e. I want it to be self-sufficient. What are my options?...

Need reasons for better hardware

I work in a .net body shop, but we have recently taken on some in-house development for a client. As we do most of our work outside the office, the current pcs are underpowered (Pentium D, 2GB RAM, 7200RPM HDD, 17inch monitor). I am pushing to get us new hardware, but the owner wants to hard facts on why/how it will help. Does anyone h...

DrawImage causing OutOfMemoryException

I am trying to re-size uploaded images. From what I have found online, the way to do this is to create a new image the size that you want it to be and then use Graphics to draw the image to a smaller image. The seems to work for every image that is uploaded except for images from a Nikon D90 camera. Every time I attempt to upload and ...

.NET ListView: event after changing selection

Hello, On the ListView control, I need an event to fire after the selection changes, but only once per user action. If I simply use the SelectedIndexChanged, that event fires twice in most cases (once when the previous element is unselected and once more when the new element is selected) event if the user only clicked on the control onc...

HttpWebRequest Timeouts After Ten Consecutive Requests

I'm writing a web crawler for a specific site. The application is a VB.Net Windows Forms application that is not using multiple threads - each web request is consecutive. However, after ten successful page retrievals every successive request times out. I have reviewed the similar questions already posted here on SO, and have implemented...

file write permission issue under "Program Files" folder

I am using inno setup to make a installation package for my application, and my application is written by C# + .Net 2.0 + VSTS 2008. Inno setup => http://www.jrsoftware.org/isinfo.php and I install my application under Program Files/Foo folder (Foo is my application name). My application is targeting to Windows Vista. The issue I found ...

Converting a 16 bit luminance value to 32 bit RGB

I have a 16 bit luminance value stored in two bytes, and i want to convert that to R, G, and B values. I have two questions: how do i convert those two bytes to a short, and assuming that the hue and saturation is 0, how do i turn that short into 8 bits per component RGB values? (apologies if this sounds like a dumb question, i just can...