5

My VB6 macro (COM) has successfully called into my managed code, COM-visible stub. My COM-visible stub has successfully started my WPF process (.exe). "Life is good". Now, I need to access a method within my WPF process and pass in some parameters.

I know that I can start my WPF process with parameters, but my VB6 macro will occasionally call my COM-visible stub with new parameters and I need to pass this into my running process.

I've thought of stopping/re-starting my process with new parameters, but that seems somewhat extreme.

How do I access a method withing my running process?

JimBoone
  • 554
  • 1
  • 7
  • 27
  • possible duplicate of [Create Out-Of-Process COM in C#/.Net?](http://stackoverflow.com/questions/446417/create-out-of-process-com-in-c-net) – Hans Passant Dec 15 '11 at 16:57

2 Answers2

1

From the operating system's point of view, a process doesn't have methods. So the only way to communicate between processes is to use some kind of inter-process communication. In C#, you could using a Remoting IPC channel or WCF. Take a look here.

Community
  • 1
  • 1
Daniel Gabriel
  • 3,939
  • 2
  • 26
  • 37
  • Sorry for the delay, I had to step back and learn how to do that. Yup, works great. Thanks for pointing me in the right direction. – JimBoone Dec 16 '11 at 13:13
1

You can host a WCF service inside your WFP application. You can then have your COM code call the service.

John Saunders
  • 160,644
  • 26
  • 247
  • 397