
Re-using a VB5 program already in memory / cmd line parameter passing
Here are some of my thoughts...
How about setting up a DDE conversation between the two apps? I'm not
familiar with DDE, but it seems like a possibility.
You could also write a file from your client app to a shared directory, say
a file for each message, and poll this shared directory from your server
app using Dir(), or better yet, use FindFirstChangeNotification() API
(there's good code for this on VBNet -
http://home.sprynet.com/sprynet/rasanen/vbnet/default.htm
Using the API would be fairly instantaneous. If your client supports it,
you could possibly use a shared database instead.
If your client supports API functionality, then you could use Named Pipes
(or anonymouse pipes in Win95 - I think) to communicate. Dan Appleman
(Desaware) covers this in 'The VB Programmers Guide to the Win32 API'.
If you've got Desaware's Spyworks then you can possible send a message to
another process. I've never tried this, but I think Spyworks has examples
of doing this. I don't know how this would work on your client end though.
I would thing the shared directory approach the easiest.
FindFirstChangeNotification() would offer better results than Dir(). Dir()
may work OK but it incurrs a lot of disk activity, especially over
networks. I would think it fairly instantaneous depending on how you poll
the directory. The quickest response would probably be through the Named
Pipes, or DDE approach.
Hope this helps
Quote:
> Dear Fred, thanks for answering!
> I am trying to run the program doing a:
> Shell "VB5PRG.EXE param1 param2 ..."
> From another non-VB5 program (an Emulator called Reflection for UNIX/VMS
> wich has very limited VBA programming capabilities, i.e. I cannot run
DCOM
> from inside Reflection). This is the only way that I have found to
> communicate the messages that are comming from the VMS host application
to
> command the client Win95 PC that runs the Shell "VB5PRG.EXE" to perform
the
> tasks provided by the ActiveX control inside of it. These messages will
> come one after another at different times from the VAX host to the
> emulating Win95 PC that should run inmediately the ActiveX control each
> time with a different type of message (this is why I was thinking of
> command line param1 param2 ... passing).
> I want to avoid the time consuming re-loading of the program, and somehow
> just send the param1 param2 ... strings to a VB5PRG.EXE program already
in
> memory.
> It can be said that the VB5PPRG.EXE will be an ActiveX server for the
> parameters received.