Re: Calling procedure on another software
From: Robert (robert_at_jcle_____.com)
Date: 05/13/04
- Next message: Ken Halter: "Re: Is an object nothing?"
- Previous message: Jim Carlock: "Re: .tmp files"
- In reply to: Ken Halter: "Re: Calling procedure on another software"
- Next in thread: Ken Halter: "Re: Calling procedure on another software"
- Reply: Ken Halter: "Re: Calling procedure on another software"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 13 May 2004 13:22:32 -0400
Hi,
Thanks a lot for these 2 samples.
I have to look more into this. But, i've think about somethings.
It seem easier to add a Client/Server control on the form. The first
instance open the server. When the second instance open, it only send a
"query" to the first instance.
The server on the instance accept and execute what's requested.
Is this a good way?
I've already work on client/server on VB, C++, Java... So i think i'll go
for this way.
Thanks a lot for your help, and i'll continue reading the website.
"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
news:OizbeiQOEHA.1392@TK2MSFTNGP09.phx.gbl...
> 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/Registeri
ng_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: Ken Halter: "Re: Is an object nothing?"
- Previous message: Jim Carlock: "Re: .tmp files"
- In reply to: Ken Halter: "Re: Calling procedure on another software"
- Next in thread: Ken Halter: "Re: Calling procedure on another software"
- Reply: Ken Halter: "Re: Calling procedure on another software"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|