HighTechTalks DotNet Forums  

Named pipes class for .NET

Dotnet Framework (SDK) microsoft.public.dotnet.framework.sdk


Discuss Named pipes class for .NET in the Dotnet Framework (SDK) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #11  
Old   
Jesse Houwing
 
Posts: n/a

Default Re: Named pipes class for .NET - 09-28-2009 , 12:12 PM






* David Thielen wrote, On 28-9-2009 19:01:
Quote:
On Mon, 07 Sep 2009 01:27:01 GMT, hongyes (AT) online (DOT) microsoft.com
("Hongye Sun [MSFT]") wrote:

Thanks, Dave,

Please let me know if you need any further support for this issue. Have a
nice day.

Hi;

This didn't work. We can post a message from our Office AddIn app to
our applet because it is a Forms based app and so it always has a main
window and that window is our program.

But we cannot post a message to aour AddIn because:

1) There may be no Window - it is running on Word/Excel/PPT but most
of the time we have no window open.

2) We can get the winword process and Word's main window - but we have
no way from that to get our AddIn's window (if we had a hidden one
that always existed).

So we're back to our core problem. How do we do IPC between an app and
an Office AddIn. All we need to do is pass a byte (that can have 5
different values).

We can't do find by class because we're .NET and have no control over
the class.

We can't do find by caption because our app is translated and so the
caption depends on the language it is running under.

I still think named pipes is the best approach - but I think they are
not shutting down when the program is exited.

So my two questions are:

1) What is the best way to perform IPC? This will always be on the
local computer.

2) If it's named pipes, is there a link to a correct example of how to
do this from .NET? Preferably a very simple implementation as all we
need to do is get a byte value across.

thanks - dave

david@at-at-at (AT) windward (DOT) dot.dot.net
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
Have you looked into WCF? It allows you to quite easily open a
connection based on a great number of protocols, including Named Pipes
based on code or configuration. It would be reasonably easy and allows
for other ways of communicating if needed.

--
Jesse Houwing
jesse.houwing at sogeti.nl

Reply With Quote
  #12  
Old   
Wilson, Phil
 
Posts: n/a

Default Re: Named pipes class for .NET - 09-28-2009 , 12:34 PM






There's nothing wrong with named pipes, and if anything, the security is a
good thing. NamedPipeClientStream (and server) seem pretty straightforward.
There's also .NET remoting (or maybe WCF) - that works fine within the same
machine too.

--
Phil Wilson
The Definitive Guide to Windows Installer
http://www.apress.com/book/view/1590592972


"David Thielen" <thielen (AT) nospam (DOT) nospam> wrote

Quote:
On Mon, 07 Sep 2009 01:27:01 GMT, hongyes (AT) online (DOT) microsoft.com
("Hongye Sun [MSFT]") wrote:

Thanks, Dave,

Please let me know if you need any further support for this issue. Have a
nice day.

Hi;

This didn't work. We can post a message from our Office AddIn app to
our applet because it is a Forms based app and so it always has a main
window and that window is our program.

But we cannot post a message to aour AddIn because:

1) There may be no Window - it is running on Word/Excel/PPT but most
of the time we have no window open.

2) We can get the winword process and Word's main window - but we have
no way from that to get our AddIn's window (if we had a hidden one
that always existed).

So we're back to our core problem. How do we do IPC between an app and
an Office AddIn. All we need to do is pass a byte (that can have 5
different values).

We can't do find by class because we're .NET and have no control over
the class.

We can't do find by caption because our app is translated and so the
caption depends on the language it is running under.

I still think named pipes is the best approach - but I think they are
not shutting down when the program is exited.

So my two questions are:

1) What is the best way to perform IPC? This will always be on the
local computer.

2) If it's named pipes, is there a link to a correct example of how to
do this from .NET? Preferably a very simple implementation as all we
need to do is get a byte value across.

thanks - dave

david@at-at-at (AT) windward (DOT) dot.dot.net
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm

Reply With Quote
  #13  
Old   
Hongye Sun [MSFT]
 
Posts: n/a

Default Re: Named pipes class for .NET - 09-29-2009 , 04:13 AM



Hi Dave,

Here are my answers to your questions:

1) What is the best way to perform IPC? This will always be on the
local computer.

Named pipes and file mapping should work for your senario.

2) If it's named pipes, is there a link to a correct example of how to
do this from .NET? Preferably a very simple implementation as all we
need to do is get a byte value across.

Please refer to: http://msdn.microsoft.com/en-us/library/bb546085.aspx
It has a sample by using NamedPipeServerStream.

Or in CodeFx samples, please check CSNamedPipeClient / Server and
CSFileMappingClient / Server. Both samples uses interop.

Please let me know if they work for you.

Sincerely,
Hongye Sun (hongyes (AT) online (DOT) microsoft.com, remove 'online.')
Microsoft Online Community Support
*
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you.
*
This posting is provided "AS IS" with no warranties, and confers no rights.

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.