CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 1999
    Location
    Michigan
    Posts
    215

    Creating custom messages across VB Apps

    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++ )


  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Creating custom messages across VB Apps

    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

  3. #3
    Join Date
    Sep 1999
    Location
    Michigan
    Posts
    215

    Re: Creating custom messages across VB Apps

    Thanks Chris!

    - Mike


  4. #4
    Join Date
    Feb 2000
    Location
    Indiana
    Posts
    308

    Re: Creating custom messages across VB Apps

    Since you're using NT, if you don't want the two applications to be tightly coupled, you could use MSMQ. Just another thought...


  5. #5
    Join Date
    Sep 1999
    Location
    Michigan
    Posts
    215

    Re: Creating custom messages across VB Apps

    Kyle,

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

    - Mike


  6. #6
    Join Date
    Feb 2000
    Location
    Indiana
    Posts
    308

    Re: Creating custom messages across VB Apps

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured