Click to See Complete Forum and Search --> : Creating custom messages across VB Apps


Michael Owen
February 15th, 2000, 09:50 AM
Hi.

I need to be able send and receive custom messages to and from another VB App. Any ideas on how this can be accomplished? My thought is to define a common set of messages ( i.e. ProcessThisFile, and FileHasBeenProcessed ) where my VB App would post a message to the other ( ProcessThisFile ) and the other VB App would post back a message ( FileHasBeenProcessed ) to me.
Thanks!

- Mike

P.S. - VB 6.0 on NT 4.0 ( and I can do this in my sleep in VC++ )

Chris Eastwood
February 15th, 2000, 10:02 AM
You can do this in a couple of ways :

1. Implement the old 'C' style message queue in your program (ie. subclass a window in one of your programs looking for a WM_WHATEVER message)

2. Implement the whole thing using COM objects / Interfaces

3. Use DDE

I'd personally go for option 2 - there's a lot you can do, especially if you want this kind of two way messaging.


Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb

Michael Owen
February 15th, 2000, 10:34 AM
Thanks Chris!

- Mike

Kyle Burns
February 15th, 2000, 01:44 PM
Since you're using NT, if you don't want the two applications to be tightly coupled, you could use MSMQ. Just another thought...

Michael Owen
February 15th, 2000, 02:01 PM
Kyle,

I'm entertaining ( party at 8 ) all ideas right now ... Any futher details on MSMQ?

- Mike

Kyle Burns
February 15th, 2000, 02:06 PM
MSMQ is a way for applications to use "mailboxes" to transfer data back and forth. Program one sends a "message" to program two's mailbox and continues to process normally. If program two is not running, the message waits for program two to pick it up and process it. I haven't played around with it much, but Wrox has a good book on MTS and MSMQ with VB and ASP. You might want to check it out.