<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>果树 &#187; C#</title>
	<atom:link href="http://blog.qevan.com/tag/c/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.qevan.com</link>
	<description></description>
	<lastBuildDate>Sat, 31 Dec 2011 05:54:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Communicating between processes with Pipe</title>
		<link>http://blog.qevan.com/posts/493.g</link>
		<comments>http://blog.qevan.com/posts/493.g#comments</comments>
		<pubDate>Thu, 20 Aug 2009 10:05:00 +0000</pubDate>
		<dc:creator>果子</dc:creator>
				<category><![CDATA[技术贴]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[VC++.net]]></category>
		<category><![CDATA[Win32]]></category>

		<guid isPermaLink="false">http://blog.qevan.com/?p=493</guid>
		<description><![CDATA[Instead of using a complicated Sendmessge between processes, there is another convenient way to communicate between processes. Pipe! There is a good tutorial and implementation demo with C#. link I just used the server client in my program. But for the c... ]]></description>
			<content:encoded><![CDATA[<p>Instead of using a complicated Sendmessge between processes, there is another convenient way to communicate between processes. Pipe!</p>
<p>There is a good tutorial and implementation demo with C#. <a href="http://www.switchonthecode.com/tutorials/interprocess-communication-using-named-pipes-in-csharp">link</a></p>
<p>I just used the server client in my program. But for the client, I used a simple C++ implementation.</p>
<pre class="prettyprint">HANDLE h=NULL;
void send_message(char *msg)
{
	if (!h)
		{
			h=CreateFile(L&quot;\\\\.\\pipe\\MyNamedPip&quot;,
			      GENERIC_READ | GENERIC_WRITE,
                  0,
                  NULL,
                  OPEN_EXISTING,
                  FILE_FLAG_OVERLAPPED,
				  NULL);
		}

	DWORD BytesWritten;
	WriteFile(h,msg,strlen(msg),&amp;BytesWritten,NULL);
	FlushFileBuffers(h);
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.qevan.com/posts/493.g/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

