Problem solve Get help with specific problems with your technologies, process and projects.

What is the best approach for making a VB 6 application communicate with my VC# .NET application?

Here our experts explain the best approach for making a VB 6 application communicate with my Visual C# .NET application.

What is the best approach for making a VB6 application communicate with my VC#.NET application? I want the information to be passed back and forth between these two applications as seamlessly as possible. Any suggestions?
This is a very common scenario, two applications that need to communicate data between themselves. There are several common ways to do this. User defined Window Messages, WM_COPYDATA Window Message, shared memory (memory mapped files), named/unnamed pipes, or Sockets. Having some experience in this area, I would highly recommend using Sockets to communicate your information between the two applications. Unless you are very familiar with Visual Basic, you are going to run into some frustration when you try to subclass your VB Forms to retrieve the Window Messages. It can be done, but it's a lot of work, and is considered some what difficult to do safely using Visual Basic.

Using Sockets however is a tried and true method for inter-process communication. Using the Winsock control in VB is trivial, and even easier in C# using the powerfull Net namespace. I would also recommend using Tcp as the transport because it is a connection oriented protocol that will keep your messages in order and provide you with a more robust error checking subsystem to verify your messages reach their destinations. You could use other protocols such as UDP, however you would need to write your own error checking and redundancy into your specific implementation.

Dig Deeper on C# programming language

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.