Home > Ask the Microsoft .Net Development Experts > C# Development Questions & Answers > What is the best approach for making a VB 6 application communicate with my VC# .NET application?
Ask The Win Development Expert: Questions & Answers
EMAIL THIS

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

Mark Belles EXPERT RESPONSE FROM: Mark Belles

Pose a Question
Other Win Development Categories
Meet all Win Development Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 28 August 2004
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?

>
EXPERT RESPONSE
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.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
C#
Top C# expert advice
Escape from mailto:
Can I run a .NET app without installing .NET runtime?
Opening a link with parameters to a new window
Is it possible to open a child form in modal type?
Painting in the non-client area
Global cases to the entire application
Validating the textbox entry for date format
Book on network programming with C#
Calling a secondary UserControl applet

C# programming language
LINQ beyond queries: Strong-typed refection
Assembly versioning in the .NET Framework 2.0
Book excerpt: Creating graphical output using the .NET Compact Framework
Visual Studio 2008 Learning Guide: C# 3.0
Simonyi firm to address divide between domain experts and developers
On Extension Methods in C# and .NET Framework 3.5
Generate RSA public and private keys, export to XML
Book excerpt: Upgrading to Visual Studio 2005
Learning .NET: Tips for getting started with .NET development
Book excerpt: Code snippets in Visual Studio 2005

C# Development
Top C# expert advice
Using LoadRunner for testing in .NET
Take care with InitializeComponent
GroupBox inheritance
Escape from mailto:
Windows Forms: Overriding the OnClosing method
Passing data between forms
Can I run a .NET app without installing .NET runtime?
Opening a link with parameters to a new window
Is it possible to open a child form in modal type?

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
C#  (SearchWinDevelopment.com)
GLib  (SearchWinDevelopment.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice

About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2000 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts