3

One is 64bit, the other is 32bit. I'm currently doing it while making the 32bit app console, and reading the output. Is there a better way? My data is text.

EDIT: Both executable are on the same machine.

blez
  • 4,939
  • 5
  • 50
  • 82

3 Answers3

1

If you are constrained to .NET 2.0 then there are a few ways you can do it:

  1. if the two apps are on different machines, you can use sockets, or .net Remoting (depending on the complexity of interaction)
  2. if the two apps are on the same machine, .net Remoting is an ok choice.

The fact that they are 32 or 64 bit does not influence this in any way.

Tudor
  • 61,523
  • 12
  • 102
  • 142
  • @blez: Then I suggest .Net Remoting. It allows you to call methods directly from one program to another. – Tudor Dec 18 '11 at 13:55
  • Isn't this using sockets? So it can be blocked by firewall or antivirus? – blez Dec 18 '11 at 13:56
  • @blez: On the same machine I think it uses shared memory. You can specify which underlying mechanism you want to use. – Tudor Dec 18 '11 at 13:58
0

In .NET 2.0 you could use Remoting.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • This is using Sockets? Can it be blocked by firewall? – blez Dec 18 '11 at 13:54
  • @blez, yes, it can be blocked. You could use a port that is in the exceptions of the firewall. – Darin Dimitrov Dec 18 '11 at 13:57
  • So, I better use named pipes or output from the console. – blez Dec 18 '11 at 13:58
  • @blez, yes, named pipes are an alternative. – Darin Dimitrov Dec 18 '11 at 13:59
  • @blez, as far as I know, named pipes in .net 2.0 can only be used by calling the native Win32 pipe API. Like I said, remoting can also use shared memory if you're on the same machine. – Tudor Dec 18 '11 at 14:04
  • @DarinDimitrov Out of curiousity: Is the IPCChannel class really using sockets that can be blocked by a firewall? – yas4891 Dec 18 '11 at 14:07
  • @yes4891: It does not use sockets. From MSDN: "Because it does not use network communication, the IPC channel is much faster than the HTTP and TCP channels, but it can only be used for communication between application domains on the same physical computer." – Tudor Dec 18 '11 at 14:58
  • @Tudor: It looks like it's actually using sockets. Cause one example I tried blocks 8080, which is used by another app. – blez Jan 08 '12 at 14:33
0

Doing IPC it doesn't matter whether programs are in 32 bit or 64 bit, so pick the method you want (see this post).

Community
  • 1
  • 1
CharlesB
  • 86,532
  • 28
  • 194
  • 218