JimBoone
JimBoone

Reputation: 554

I've started a process, how do I call a method in that process

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?

Upvotes: 5

Views: 1926

Answers (2)

John Saunders
John Saunders

Reputation: 161773

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

Upvotes: 1

Daniel Gabriel
Daniel Gabriel

Reputation: 3985

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.

Upvotes: 1

Related Questions