Solved

Messages between VB6 and .NET

Posted on 2004-08-23
6
311 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 168 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 166 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 166 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why use this lambda? 12 96
parsing question on dynamic concatenation 3 40
Example code 13 43
XML Constructor Throwing Incorrectly Structured Document Error 4 24
Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 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