Pass arguments to application after started
Hey, I'd like to ask if any of you know how to use Visual Basic to pass arguments to an application after said application was started.
Example, "myapp.exe -d" enables debug mode, I want to be able to start myapp.exe then have a checkbox labeled "Debug mode" in Visual Basic. Upon "Debug Mode" being checked, it passes the argument -d to myapp.exe. Upon it being unchecked, it withdraws that argument from myapp.exe.
Thanks for your help,
-Arightwizard
Re: Pass arguments to application after started
Is this checkbox in your myApp.exe or an outside application? If it is part of myapp.exe, can't you just run through the same logic that happens at start up to turn on/off the debugging?
If it is outside your application, you can set your application to be a single instance and catch the appropriate event when something tries to launch a new instance. I think it is the StartupNextInstance event, but it has been a while since I have done that, so you might need to double check that.
Re: Pass arguments to application after started
Quote:
Originally Posted by
Negative0
Is this checkbox in your myApp.exe or an outside application? If it is part of myapp.exe, can't you just run through the same logic that happens at start up to turn on/off the debugging?
If it is outside your application, you can set your application to be a single instance and catch the appropriate event when something tries to launch a new instance. I think it is the StartupNextInstance event, but it has been a while since I have done that, so you might need to double check that.
It is outside of myapp.exe however I have found nothing similar to that command which you just said.
In case you missed a key part of what I said (I think you did but I'm not sure), I want to pass the argument after myapp.exe was already started.
**Edit**: I found it, but I have no clue how it could help me.
Re: Pass arguments to application after started
What version of VS are you using? To do what I set, you need to be using the Application Framework, which is under the Application tab in Project Properties in VS2008. You can then use the View Application Events button to get to the code where you can put the event that I mentioned.
Re: Pass arguments to application after started
Visual Studio 2010 with .NET framework 4.0 beta 1.
I'd really appreciate a reply. Thanks.