我尝试为本地进程间通信开发匿名管道,参考这篇文章... http://msdn.microsoft.com/en-us/library/bb546102.aspx
我把这两行放在 testApp.cpp
#using <System.dll>
#using <System.Core.dll>
using namespace System;
using namespace System::IO;
using namespace System::IO::Pipes;
using namespace System::Diagnostics;
void testApp::setup() {
}
void testApp:update() {
}
void testApp:draw() {
Process^ pipeClient = gcnew Process();
pipeClient->StartInfo->FileName = "pipeClient.exe";
AnonymousPipeServerStream^ pipeServer =
gcnew AnonymousPipeServerStream(PipeDirection::Out,
HandleInheritability::Inheritable);
// Show that anonymous pipes do not support Message mode.
try
{
Console::WriteLine("[SERVER] Setting ReadMode to \"Message\".");
pipeServer->ReadMode = PipeTransmissionMode::Message;
}
catch (NotSupportedException^ e)
{
Console::WriteLine("[SERVER] Exception:\n {0}", e->Message);
}
Console::WriteLine("[SERVER] Current TransmissionMode: {0}.",
pipeServer->TransmissionMode);
}
他们表明,
"Error:"#using" requires C++/CLI to be enabled
在#using <System.dll>
,所以,在项目上
Properties->Configuration Properties->General->Common
语言运行时支持,我将其从“无通用语言Runtime
支持”更改为“ Common Language Runtime Support (/clr)
”。
然后我尝试重建并得到另一个错误是
Command line error D8016: '/ZI' and '/clr' command-line options are incompatible..
现在我完全失去了..
有没有人有关于如何在 0.7.4 上构建匿名管道的解决方案?
提前致谢。
OpenFrameworks 0.7.4 / Visual Studio 2010 / compiler v100