VB 6 app calling C# windows service

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Guys,

Has anyone written a windows service in C# that used multiple threads, then
wrote a VB 6 application that called the various methods on the C# Service?
Any problems with it?

Thanks
 
No, I haven't ;)

But I think you should be more specific, such as: how do you communicate?
What kind of problem do you expect?

Reading you I guess you simply have multithreading error, that's nasty one
and hard to debug.
Remember very few classes of .NET are thread safe by default (except the
client/server, IO one), it's up to you to provide the safety otherwise.
 
Yes, I have. As a communication mechanism, I have used sockets to send the
commands to the C# service and then to receive the results back. All of my
command data structure is in XML along with the return data for this process
which makes it flexible. I have used a similar mechanism with Java also.
This is a syncronous method. If you want an asyncronous format then look at
MSMQ to be your communication bridge. As Lloyd noted, you must be careful
about concurrency when using multiple threads in C#. Make sure to lock
objects that might need to be shared between threads unless you can deal with
dirty reads.
 
Back
Top