Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Messages between VB6 and .NET

Posted on 2004-08-23
6
Medium Priority
?
322 Views
Last Modified: 2012-06-27
Is there a way to send messages between two applications.  Specifically, I will need to send messages from a C# application to a VB6 application.  (The VB6 app kind of functions like the parent of the C# app so they can be coordinated, so I need to be able to send messages from the C# app to the VB6 app to make things happen.)  Could it go the other way around?

Thanks in Advance,
Eric
0
Comment
Question by:egibson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 10

Accepted Solution

by:
eternal_21 earned 672 total points
ID: 11871835
There is nothing special about .NET applications that allows two of them to communicate to each other.  You could accomplish inter-application communication using DDE or .NET Remoting as a couple of examples.
0
 
LVL 22

Assisted Solution

by:cookre
cookre earned 664 total points
ID: 11872913
If you're up for a small challenge, you could use the Window's message pump by having your own WndProc in each program (attached to its own hidden window) to snag custom messages sent with PostMessage().  

Or, you could catch them with a local hook via SetWindowsHookEx().

Another common way is to create your own message queue with MSMQ:
http://aspdot.net/aspnet/msmq.aspx
0
 
LVL 7

Assisted Solution

by:NipNFriar_Tuck
NipNFriar_Tuck earned 664 total points
ID: 11892993
You can also use the attribute to make the .Net application COM capable, and allow eventing through the COM piece.

Check out for more discussion on this...

http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_21083444.html#11727127
0
 
LVL 22

Expert Comment

by:cookre
ID: 11893412
Someone just posted this easy way to get into the message pump in .NET - add a WndProc override:

protected override void WndProc(ref Message aMessage)
{
if (aMessage.Msg == your message)
   {
   //do something
   }
else
   {
   base.WndProc(ref aMessage);
   }

Just make up your own message codes, making sure they're above 0x0400.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question