![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
There are a ton of implementations out there - and they all take a different approach. All we need is a way fortwo apps on the same machine to talk to each other. |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
There are a ton of implementations out there - and they all take a different approach. All we need is a way fortwo apps on the same machine to talk to each other. Named pipes are not the best mechanism for solving your task due to security complexities and some bugs in internal named pipe implementation. Memory Mapped Files with some synchronization primitives or Windows Messages are way better. You might want to take a look at MsgConnect product, which offers a uniform way to send messages between applications running on the same or different computers. See http://www.eldos.com/msgconnect/ |
#5
| |||
| |||
|
|
Hi Dave, Thanks for your post. There are many named pipe implemenation because there are many ways to do it. In order to make sure which is the best way to implement it, you have to clarify following questions: 1. Does your application require asynchronous usage of Named Pipe? 2. Are writing native code or managed code? Since .NET 2.0, it adds a new namespace: System.IO.Pipe. It eases the usage of named pipe in .NET langauges instead of interop. For asynchronous usage of Named Pipe, it depends on your requirement of the two apps. Do you want to the sender to wait for the receiver to complete? CodeFX has a very good example to explain the usage of Named Pipe in both native and .NET. For detail, it has a code project article to explain named pipe: http://www.codeproject.com/KB/threads/CodeFX_IPC.aspx For downloading the latest version of sample code, please go to: http://cfx.codeplex.com/ Please let me know if codefx sample code meets your needs. Thanks. |
#6
| |||
| |||
|
|
MsgConnect looks like overkill for our use. Is there an example somewhere of a simple way to use messages? We just need to send receive a byte (which has a value of 0 - 5 for what is occuring). |
#7
| |||
| |||
|
#8
| |||
| |||
|
|
Hi Dave, Other than find window by its caption, you can also get it by process name, here is an sample code: Process[] processes = Process.GetProcessesByName("notepad"); foreach (Process p in processes) { IntPtr pFoundWindow = p.MainWindowHandle; // Do something with the handle... // } Another alternative is still using FindWindow, but by class name instead of caption. You have to register the window class name before find it. Here is an example: http://stackoverflow.com/questions/128561/registering-a-custom-win32-window- class-from-c |
#9
| |||
| |||
|
#10
| |||
| |||
|
|
Thanks, Dave, Please let me know if you need any further support for this issue. Have a nice day. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |