Best VB.NET approach to same box interprocess communication?

  • Thread starter John Heitmuller.
  • Start date
J

John Heitmuller.

I have a need to pass data between instances of a VB.NET application
running on the same box. What is the best approach to creating this
application as a VB.NET application?

As a test I'd like to create a single application with two multi-line
TextBoxes and a (Send) button. One TextBox is labeled (Message) and
the other is labeled (Conversation). Multiple instance of the
application can be run on the same box at the same time. When the
user types text in the (Message) TextBox and presses the (Send) button
the message text should be added to the (Conversation) TextBox of each
instance of the application ruining on that PC.

I have figured out how to do this by making calls to user32.dll and
sending Windows messages at the OS level. I am concerned that using
this approach will create OS version dependencies and upgrade
problems.

It looks to me that the way to accomplish this via the .Net Framework
is through Remoting. As I understand .Net Remoting you cannot
accomplish this with a single application. You need to create a
Listener app and a Client app. So for my test application I'd have to
create a Lister that runs as a service and a Client app that can be
run many times with each instance connecting back to the Listener.
This all seems unnecessarily complicated. So, I feel like I'm missing
something.

Any suggestions?
Thanks,
John
 
T

Tom Shelton

Ok, you should be asking over on the .NET groups - but, I can still
answer a couple fo these...
I have a need to pass data between instances of a VB.NET application
running on the same box. What is the best approach to creating this
application as a VB.NET application?

The answer to this question really depends on the version of the
framework your targeting, and the level of complexity of the
communication. Other factors might include - are you only talking to
other .NET apps? What protocols do those other applications support?

For instance, for simple short strings between apps on the same box, and
that I control - I often have used WM_COPYDATA to send the data. For
example, when I am creating a single instance app, but want to pass the
commandline of the just started instance to the already running
instance. Sure, I could use sockets, remoting, pipes, mailslots, or
even a memory mapped file - but, those solutions just add a level of
complexity that is unnecessary. Of course, now that I'm targeting 3.5 -
I might actually use Pipes since they are part of the framework now
(System.IO.Pipes).
 
T

Tom Shelton

Ok, you should be asking over on the .NET groups - but, I can still
answer a couple fo these...


Sorry - I thought I was on the VB classic group when I responded :)
 
S

SurturZ

lol, now I'm tempted to complain about the lack of constructors in VB6 on
vb.general.discussion
 
T

Tom Shelton

lol, now I'm tempted to complain about the lack of constructors in VB6 on
vb.general.discussion

--
David Streeter
Synchrotech Software
Sydney Australia





- Show quoted text -

Lol... Of course, if you use proper oo design guidlines, they
shouldn't be necessary anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top