Re: Calling procedure on another software
From: Ken Halter (Ken_Halter_at_Use_Sparingly_Hotmail.com)
Date: 05/13/04
- Next message: Mike S.: "Masking Double Variables"
- Previous message: Mark: "Displaying Data with MSChart"
- In reply to: Robert: "Calling procedure on another software"
- Next in thread: Robert: "Re: Calling procedure on another software"
- Reply: Robert: "Re: Calling procedure on another software"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 13 May 2004 09:37:42 -0700
Robert wrote:
> Hi,
>
> I'm trying to find a way to make a software react when an instance is
> already running.
> Here what i want:
>
> Execute a software called Test1.
> Execute this software again.
> The second instance should send a message to the first instance.
> Then, the second instance stop executing.
>
> I put this code in the Form_Load procedure:
> If app.PrevInstance Then
> SaveTitle = app.title
> app.title = "... duplicate instance."
> Me.Caption = "... duplicate instance."
> AppActivate SaveTitle
> ''''' Right here, i need to execute app.PrevInstance.SomeProcedure
> End
> End If
>
> Someone know how to run the procedure on the first instance?
What you'll need to do is add command line support to the app. That
second instance can send a command line to the first. VB's built in
Command$ variable will contain any command line params you send to an app.
There are quite a few examples showing how to do this. Here's a great
way.. it's a bit on the "advanced" side.
Registering File Associations and Passing Command Line Parameters to an
Existing App Instance
http://www.vbaccelerator.com/home/VB/Code/Libraries/Shell_Projects/Registering_File_Associations/article.asp
If you want an easy way, I have a sample that may help. It's a bit
different. Very easy. Just drop a control (included) on the form and
"talk" to other apps that also contain the control.
Communicate with another instance of your app
http://www.vbsight.com/Code.htm
It's not as "rock solid" as the first sample but for most situations, it
works great.
> It will really help me, and i greatly appreciate your help.
>
> Thanks,
>
> Robert
>
>
-- Ken Halter - MS-MVP-VB - http://www.vbsight.com Please keep all discussions in the groups..
- Next message: Mike S.: "Masking Double Variables"
- Previous message: Mark: "Displaying Data with MSChart"
- In reply to: Robert: "Calling procedure on another software"
- Next in thread: Robert: "Re: Calling procedure on another software"
- Reply: Robert: "Re: Calling procedure on another software"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|