I'm writting a Windows Forms application in C# that performs a lot of long-running procedures. I need to program the application so that the GUI doesn't lock. What is the best way to program it?
I know how to use the following:
BeginInvoke/EndInvoke
Calling Application.DoEvents() repeatedly (probably not a good idea)
BackgroundWorker
...
I've wrote a Interop Assembly for a COM library. Everything was fine, except when I've tried to support events.
This is my coClass definition:
coclass NetCustomWatcher
{
[default] interface INetCustomWatcher;
[default, source] dispinterface _INetCustomWatcherEvents;
};
It's pretty simple.
I read a lot of articles...
I have a .net application (c#, Winform and libraries) that I want people to download from the Internet freely. But once installed they'll only be able to run it if I give them a license (and I want to be able to give different licenses according to what feature I want to unlock).
I also want the license to be time-limited. After it expir...
I have seen some good recommendations here before about using the VisualBasic assemblies (WindowsFormsApplicationBase) to nicely create a splash screen followed by the main form.
I have an app that I want to put into some sort of loop whereby I want to repeat this cycle. For example during the splash screen I login to an available serve...
I'm displaying a very big tree with a lot of items in it. Each of these items shows information to the user through its associated UserControl control, and this information has to be updated every 250 milliseconds, which can be a very expensive task since I'm also using reflection to access to some of their values. My first approach was ...
Right now I only know about Visual Studio 2008 Shell and the custom control used in the Snippet Compiler.
Also is VS shell suitable for this job? I don't know if it's a custom control or a standalone app? Any tutorials about it?
I would imagine the Snippet Compiler's custom control to be usable and therefore should work, but I still wa...
I'm studying .NET Remoting and I see an example on Remoting callbacks and events in .NET 2.0, A simple example. All works good.
Now my problem is if I try to start another client, the server doesn't callback to all clients connected to it but only to the last one.
How can I send callback to all clients?
...
Hi
I have a base controller that I made so I can pass data to the master page view easily. However this base controller gets a service layer passed into it and everything time I run my unit tests this service layer kills it since it tries to access some database stuff.
private ServiceLayer service;
public ApplicationControll...
I've not bothered with panels, docking, or anchors. I've simply thrown together a ToolBar control (not ToolStrip) and seem unable to size it.
System.Windows.Forms.ToolBar tb = new System.Windows.Forms.ToolBar();
// Reports 292x28 (approx) if I check width and height
// Basically the width of the form and I assume a default height
tb.S...
I wonder whether there are some guidelines that I can use for coding Winform applications in .net, preferably in C#?
For example, when I initialize data bindings for a form, shall I put the initialization code in the loading event of the form or in the constructor of the form? What is the correct way of adding controls/components from c...
Hi!
I want my application to be distributable as a single .exe file but I want to be able to get nice error reports with source code line numbers (the application simply sends email with exception.ToString() and some additional information when unhandled exception occurs).
Is there any way to embed .pdb into assembly?
...
I need to send a list of commands to SQL 2008 using ADO.NET, to be executed one after the other. Should I create a new SQLCommand for each SQL that I'm sending?
Or reuse the same SQLCommand and just change the CommandText property?
Thanks, Nestor
...
I have some code that adds a Func<short> to a Dictionary<byte, Func<short>> at index 0. Later on, some code within the class that contains the dictionary attempts to extract this Func (via TryGetValue) and execute it, throwing an exception if it does not work. Even though the index being accessed is valid, it throws the exception that si...
Hi,
As suggested on msdn social forum,
http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/ab59671a-f0a3-4182-ba5b-7fa17f0a6118?prof=required
I turned off the the Visual Studio hosting process and verified that the changes are saved to MyApp.exe.config file instead of MyApp.vhost.exe.config file when still running under Debug...
Hi
I have my own custom Authorize Attribute and I am trying to check my controller methods to see if they have the correct roles in place. Now my custom authorize tag has database code in it.
The ways I am mocking it up don't seem to work since the reflection stuff I found seems to to just pass no arguments so my default constructor i...
How to get column size from database in .NET?
...
Hello stackoverflowers!
I'm using Exchange Web Service exposed from exchange 2007 SP1 server to create emails from my application and I've encounted a problem I can't figure out.
I get this response "When making a request as an account that does not have a mailbox, you must specify the mailbox primary SMTP address for any distinguished...
Hello,
I'm developing a program that searches for a running program and press a button on it automatically But How can I press the enter key on the keyboard from my code (send the command of the enter key)?
Thanks.
...
I have a program i frequently use that is made with .NET.
This program has a small bug that is very annoying and the developer to the app is nowhere to be found.
I have found the location of the problem in reflector and just want to add a single if-statement here and then recompile the program.
What is the easiest way to do this?
I ha...
In my application I want to add some items to my cache, but these items should be at most one day old.
Is there an OOTB way to set the maximum life for certain objects?
...