Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 409
  • Last Modified:

Already Running Applications and Command-Line Arguments

I have an application I want to load files by double clicking, the following questions came from my attempts:

1. How do you pass command-line arguments to an application if it is already running, and the AppActivate procedure does not manage to activate the application except when running from VB?
2. How do you clear a command-line argument?

Thank you, Phil
0
PhilAI
Asked:
PhilAI
  • 3
  • 2
1 Solution
 
PhilAIAuthor Commented:
I have an application I want to load files by double clicking, the following questions came from my attempts:

1. How do you pass command-line arguments to an application if it is already running, and the AppActivate procedure does not manage to activate the application except when running from VB?
2. How do you clear a command-line argument?

Thank you, Phil
0
 
timd_jonesCommented:
You can't pass a command-line argument to an application that is already running.

If you are trying to control an application that is not your own, you may be able to control it if you can reference the other application's object library in your Visual Basic application. If the application you are launching is your own VB app, then you can establish communication between the apps using COM methods, or windows sockets, or a common location in the registry to pass values, etc.

AppActivate is purely a VB, VBA or VBSCript command, but you should be able to "activeate" any application where you know the exact window title.

A command-line argument inside of your own VB app is simply a variant array, and you can just set it to Empty, or ignore it.
0
 
spauljosephCommented:
From your question I understand that you're trying to pass some data to an existing (already running?) application from the launched application. You can refer a program from here http://zephyrit.netfirms.com/PassString.Zip (right-click on choose Save Target As...) for knowing about passing strings from an application to already running application.

To use that program. Extract the zip file and open the ReceiveData.vbp first and start it and then open SendData.vbp and start that. check how it is tranmitting strings and numerics. Hope that helps.

NOTE: command-line arugments wont help you in this context as timd_jones said.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
PhilAIAuthor Commented:
timd_jones: Thank you for confirming that; it is in fact my own appication and I have used Winsock control before.

How would I set it the command-line to empty, exactly?

Thanks
0
 
timd_jonesCommented:
Try

ReDim Command(0)

to clear the array
0
 
PhilAIAuthor Commented:
That works, bit dodgy, but it works - it is not like I want to use the Command-line again after.

Thank you
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now