|
-
Sep 4th, 2009, 02:13 PM
#1
Thread Starter
Member
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
-
Sep 4th, 2009, 02:39 PM
#2
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.
-
Sep 4th, 2009, 02:42 PM
#3
Thread Starter
Member
Re: Pass arguments to application after started
 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.
Last edited by Arightwizard; Sep 4th, 2009 at 02:45 PM.
-
Sep 4th, 2009, 02:46 PM
#4
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.
-
Sep 4th, 2009, 02:46 PM
#5
Thread Starter
Member
Re: Pass arguments to application after started
Visual Studio 2010 with .NET framework 4.0 beta 1.
I'd really appreciate a reply. Thanks.
Last edited by Arightwizard; Sep 4th, 2009 at 03:10 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|