473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Seeking Advice for Inter-Application Communication (VB6 to C#)

I need to communicate between two applications. The legacy application is in
VB6. New development is in C#. Here's the scenario:

The VB6 app will be pumping document files into a folder. We'll be writing a
new (C#) class for this new feature.

The C# Application (as distinct from the file pumper class just mentioned)
needs notification for each file pumped into the folder in order to process
the file.

(FileSystemWatcher is not going to do it for us. The C# Application needs
certain meta-information regarding each file, that the VB6 application is in
possession of. Yes, pairing a companion tag file together with each document
file might do the job, but is this really the best way to communicate
between two applications? By passing files around?)

So what is the best way to set up a 'conduit' beteen two applications? The
pattern I'm trying to achieve would have the source application initiate an
activity which would trigger an event raised in the target application to
notify the target application that the activity has occurred.

Thanks for any advice which you can offer!

- Joseph Geretz -
May 26 '06 #1
5 4107
On Fri, 26 May 2006 11:57:55 -0400, "Joseph Geretz"
<jg*****@nospam.com> wrote:
I need to communicate between two applications. The legacy application is in
VB6. New development is in C#. Here's the scenario:

The VB6 app will be pumping document files into a folder. We'll be writing a
new (C#) class for this new feature.

The C# Application (as distinct from the file pumper class just mentioned)
needs notification for each file pumped into the folder in order to process
the file.

(FileSystemWatcher is not going to do it for us. The C# Application needs
certain meta-information regarding each file, that the VB6 application is in
possession of. Yes, pairing a companion tag file together with each document
file might do the job, but is this really the best way to communicate
between two applications? By passing files around?)

So what is the best way to set up a 'conduit' beteen two applications? The
pattern I'm trying to achieve would have the source application initiate an
activity which would trigger an event raised in the target application to
notify the target application that the activity has occurred.

Thanks for any advice which you can offer!

- Joseph Geretz -


have a look at
http://www.codeproject.com/dotnet/VB...select=1114812
--
Ludwig Stuyck
http://www.coders-lab.be
May 26 '06 #2
Well, from VB6 to C# you could:
* Enable COM for the relevant C# code and invoke that from the VB
* Use HttpListener to create a primitive web-server and communicate perhaps
via xml posts / response
* Use sockets (not so easy from VB6, but can be done maneagably via
3rd-party dlls)
* Use a backend polling store (db / file system / msmq)

If you want callback (I'm assuming the last line should have read "...notify
the source application...") then COM is probably your best bet (from VB6),
as IIRC simple events like EventHandler pose no real problems. Long term
something like Indigo might help (sorry... WCF; force of habit ;-p) , *if*
somebody produces a VB6/WCF plug-in. Personally I doubt that anyone will
bother too much, as it is often far too tempting to switch to VB.Net or C#
instead.

Oh, and "tut tut" to the cross-post.

Hope this helps,

Marc
May 26 '06 #3
Interoperate between VB6, I assume it is a COM object, with C#. The new
features put it in C#.

chanmm

"Joseph Geretz" <jg*****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
I need to communicate between two applications. The legacy application is
in VB6. New development is in C#. Here's the scenario:

The VB6 app will be pumping document files into a folder. We'll be writing
a new (C#) class for this new feature.

The C# Application (as distinct from the file pumper class just mentioned)
needs notification for each file pumped into the folder in order to
process the file.

(FileSystemWatcher is not going to do it for us. The C# Application needs
certain meta-information regarding each file, that the VB6 application is
in possession of. Yes, pairing a companion tag file together with each
document file might do the job, but is this really the best way to
communicate between two applications? By passing files around?)

So what is the best way to set up a 'conduit' beteen two applications? The
pattern I'm trying to achieve would have the source application initiate
an activity which would trigger an event raised in the target application
to notify the target application that the activity has occurred.

Thanks for any advice which you can offer!

- Joseph Geretz -

May 26 '06 #4
Hi Marc,

Thanks for your reply.
If you want callback (I'm assuming the last line should have read
"...notify the source application...")
No, what I'd like is for the ability to have both applications share a
single instance of a class, so that a method called by the source
application, will cause an event to be raised to the target application.
This is not a new concept. Certainly, if I'd have the two applications
engineered as separate Forms in a single application this would be eminently
possible. What I'm looking for is a way to use this design pattern in an
inter-application scenario.
Oh, and "tut tut" to the cross-post.
vb.com - source application is VB6
csharp.com - target application is in C#
..interop - ties it all together

Why would you deny this discussion to any of these groups?

- Joseph Geretz -

"Marc Gravell" <ma**********@gmail.com> wrote in message
news:eX**************@TK2MSFTNGP02.phx.gbl... Well, from VB6 to C# you could:
* Enable COM for the relevant C# code and invoke that from the VB
* Use HttpListener to create a primitive web-server and communicate
perhaps via xml posts / response
* Use sockets (not so easy from VB6, but can be done maneagably via
3rd-party dlls)
* Use a backend polling store (db / file system / msmq)

If you want callback (I'm assuming the last line should have read
"...notify the source application...") then COM is probably your best bet
(from VB6), as IIRC simple events like EventHandler pose no real problems.
Long term something like Indigo might help (sorry... WCF; force of habit
;-p) , *if* somebody produces a VB6/WCF plug-in. Personally I doubt that
anyone will bother too much, as it is often far too tempting to switch to
VB.Net or C# instead.

Oh, and "tut tut" to the cross-post.

Hope this helps,

Marc

May 26 '06 #5
Re source / target - I see what you mean; I read that line twice on Friday,
and thought I had it straight, but now I see what you mean. Lack of caffeine
(on me) last week I guess. Given your requirements, I maintain that COM
interop would be a viable (and simple) solution.

Also - it wasn't my intent to suggest that it was / wasn't relevant to those
groups... but cross-posting is just a major PITA for everyone except the
original poster. I can't see if somebody has already given the 100% perfect
solution (in another group) without going to a lot of hastle to look in
those groups. Seeing as there are more readers that original posters (=1),
then this means that either lots of people only see 1/10th of the replies,
or they also need to go out of their way. OK, some news clients will make
this easy. But some won't. Thats all. I'll shut up now ;-p

Best of luck,

Marc
May 30 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Naser | last post by:
How can I change the text of a textbox in a form of a .NET application, By clicking a button in a form of an other .NET stand alone application? I know that DDE is no longer supported in the .NET...
5
by: Mark Fisher | last post by:
I have a Java desktop GUI application that the user can run multiple times. In order to keep one instance of the application distinct from another, I'd like to put the instance number of the...
14
by: Wolfgang Keller | last post by:
Hello, as a non-developer I am currently participating in an industrial "research" project to develop a so-called "web application". This application serves at the same time as middleware to...
4
by: Viper Venom | last post by:
Dear All: I am trying to write an application that consist 2 executables 1) Server.exe 2) Client.exe I start the server.exe first and then start the two client exe by code and kill both of...
2
by: PeteZ | last post by:
Hi, I was of the understanding that Session variables were GLOBALLY scoped across all Applications on a specific web site and that data obtained and stored in "variables" were available for...
0
by: msnews.microsoft.com | last post by:
Ok, I am looking for suggestions here. I have a .NET (1.1) application and I need to allow a non-.NET application to communicate with it so they can control my application. The other...
11
by: Olie | last post by:
This post is realy to get some opinions on the best way of getting fast comunication between multiple applications. I have scowered the web for imformation on this subject and have just found...
0
by: mohitjaitly | last post by:
Hi, I need to ask how can I develop web pages in ASP.NET and use them as COMPONENTS and call them or directly use them from some other APPLICATION.I should be able to use design and functionality of...
2
by: gireesh21 | last post by:
Hi every one, I am using vb.net for my application & i nee to communicate with the other application which is in VB 6.0, at runtime they sholud communicate each other. can any one please...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.