Single Instance Application Won't Load Multiple Instances
Dec 13, 2008
I have set the "Make single instance application" check box.And when my application version is 22.214.171.124 for example, it is OK and won't load multiple instances.But when I create a new version, for example 126.96.36.199, then I can run 2 instances of my application, when the 1st instance is 188.8.131.52 and the second instance is 184.108.40.206.What should I do to prevent this?
I have a form which displays temperature and humidity data for a device in the field. I have multiple devices. Rather than creating a separate form for each device, obviously it is much better to have a single form that I instantiate, pass data to, and display. The devices are listed in a treeview, and when the user double-clicks the node, I create an instance of the form, pass the device's data to the instance of the form, and display the form. All of this works perfectly. However, I have a challenge: If the form for a particular device is already open, I don't want another one opened when the user double-clicks the node.
However, whenever I place logic in the program to check for the existence of the form and only allow another instance to be created if one doesn't already exist, it prevents me from creating a form instance for any other device that I may wish to view, simultaneously. So, I have a dilemma -- allow the user to display the data for multiple devices, including allowing multiple forms to be open for a single device, OR only allowing one device to be displayed at any given time.
I've got two sets of lists with nearly 800 items that I need in 32 different drop down comboboxes (before you ask, that is required and it can't be simplified). Understandably, populating each of them slows down the creation of the form. This happens to be a child form that these drop downs are on and there could be more than one child form displayed. I've assembled the lists in List(Of String) objects and set each of the datasources of the comboboxes appropriately, but it still takes several seconds for them to populate and display for the first time. This is also problematic if the datasource gets updated (items removed, added, renamed) because I have to wipe out all the items and create the list again in all active instances.
I am writing a program in VB.net (vs 2008) that requires that only one instance of the executable be running at a time. Naturally I went for the simple solution by selecting the "Make single instance application" checkbox in the Project properties. Unfortunately, this option does not seem to work across multiple users that are logged into a single XP machine, thereby causing the same issues for my program as if I were able to run multiple instances on one single user. Granted this is a corner case, that someone would switch users while my program is running, but I'd like to understand the limitations. So my question is whether the "Make single instance application" property is supposed to work across multiple users? or is it limited to only one-instance-per-user.
Here are the steps the recreate the issue (prereqs: computer with XP pro installed, 2 user accounts (not on a Windows Domain), and a dummy "single instance" program created using the property mentioned above):
1) Log in with user1, start up the single instance program 2) Switch to user2 (StartMenu -> LogOff -> Switch User) 3) Start up the single instance program using user2
*After step 3, the program launches without complaint even though another instance is running on user1. Is this a glitch? or by design?
2. FunctionLayer -deals with Common Operations which get results from DataLayer and return results to Forms.3. User - deals with User. (For Reusing the User Class in other projects, i have separated this class)Here in Class2 - I have an instance of Class1( ie., DataLayer) for DB Operations.imilarly in Class3- I have an instance of Class1( ie., DataLayer) for DB Operations.Now in my form, If i create Instance of Class2. But When I need user functionality in this form, I have to create an instance of Class3 to this form.
I have a single instance VB 2010 application I know how to communicate with the next instances run through the StartupNextInstance application event. The usual way of working with this is parsing command line arguments of the new instance and continue execution of the old instance. What I would like to do is replace the running instance with the new one. Is there any way to do this other than disabling the single instance property ?
Which is the best way to store application and user settings of an application running with multiple instances?My problem is that using the vb's "Application Settings" one instance would overwrite the other one.I want to identify each instance with a number passed via command line argument. I could use this number to identify the appropriate settings of the running instance, but I see in a local INI o XML file a better way to handle that.
I have an application which the user can open multiple instances on the same machine. However, a section of the app would have sync problems if more than 1 instance has control over it. This is where I thought of transferring control, or sharing, between them. What should I be looking into?
They would have to be able to identify which one of them has control and to send text information over. I thought IPC or Named Pipes could do the trick, but I'm unfamiliar with them and examples seem to indicate only a single server will work. Here, I have multiple instances of the same app and every one of them needs to be able to listen for that request for control.
i am using "Animated Window Effects with "Toast" popup demo" code from the code bank created for jmcilhinney. I put a NotifyIcon control on it and check Make single instance application on the project properties windows. the problem is that every time that i launch the app it creates one instance on the system tray of the app. i can not figure out how to over come this attached is a copy of my project.
I made a simple "restarter" app... However, I need to close multiple instances of an application. For example, if I have three windows of paint, or three windows of Word open, how do I check if it is still open before I open a new instance?
I have a VB .NET application set as single instance. When I try to launch the application the second time its window is restored to its normal windowed state instead of being maximized (like it was before attempting the second launch). How can I make the application window to preserve its last state?
I'm trying to build a single-instance application, but not in the traditional sence. Instead of a simple silent prevention of launching a second application, I want it to send a message to said application so it launches a second mainform in my original process.
(I want some read-only cache (language, style,...) shared, and a few sources like local settings shared, but other then that all resources reside in the mainforms and act as seperate applications.)
(I'm not looking for specific code, more for hints/tips and/or general directions, more specificaly on what parameters do you check process equality, and what method do you use to pass the message? Windows Messages? Sockets? ...)
Has anyone using VB.NET 2010 been able to create a single instance application? I've followed the MSDN sample but it does not have an Application.xaml file. Converting any C# samples to VB doesn't work as I cannot override the Main sub in Application.xaml (C# calls it App.xaml).
I wish to turn on the Single Instance Application choice in Visual Studio 2008 properties. To do so, I must choose "Enable Application Framework". When I do that, my ONLY choice is to choose a Startup Form, not a Startup object. This makes no sense to me. I have a tray application, and I check to see which form I should load, a logon form, or the main form. But since I am forced to choose a startup form, I MUST load the logon or main form to begin with. But I don't want to. I want startup code to determine which one to load first. So then I am playing with making the OTHER form invisible, even if the startup form, but that is a mess.
I am looking for a way to make my app running in a single instance mode and showing the MainWindow of the first instance when another instance is launched.I do a quick search on the internet but I did'nt find anything to open the MainWindow of the first instance or it was for Windows Form not for WPF.
I have a windows forms application with one exe and several dlls(Class libraries) in a single solution. The application uses common data that is used across all the dlls. I would like to load the data when the application is starting up and use the loaded data at various points in the dlls so that I do not have to load the common data again and again. How can I share the data loaded in main EXE across the DLLs?
I need to be able to run multiple instances of a standalone (3rd party) application. This application prevents multiple instances from being ran from within the application. I need to basically override this.
I know it can be accomplished by hexing the original executable, however I would like to stay away from this method as I'd like for other users to be able to use my application from the get go without needing to hex the 3rd party app themselves or me having to send them the hexed app. Is there any way to achieve this or am I just taking crazy pills?
If you mark your application using "Make Single Instance Application" option in the application settings tab and run your application under a GUEST account or a restricted limited/standard account the application throws UnAuthorizedAccessException or CantStartSingleInstanceException.
Take the following steps to reproduce this behavior.
1) Create Windows Form application.
2) Enable the "Make Single Instance Application" in the project properties.
3) Log onto a GUEST account and open the application twice to simulate StartUpNextInstance.
We need developers to reproduce this behavior and post any valuable input if you experience these symptoms.
When posting information please include the following:
a) The operating system version + service pack.
b) The .NET framework version used.
c) Verify this symptom is present when running under GUEST account.
To workaround this issue turn off the "Make Single Instance Application" option ad create a Local named mutex in the StartUp() event.