adobeair NativeProcess与c++ Windows(非控制台)应用程序的通信
Adobe Air NativeProcess communication with C++ Windows (non-console) application
如何在非控制台c++应用程序中实现侦听器以侦听来自adobeair的标准输入?
在c#控制台应用程序中,它看起来像:
namespace HelloNativeProcess
{
class Program
{
static void Main(string[] args)
{
using (Stream stdin = Console.OpenStandardInput())
using (Stream stdout = Console.OpenStandardOutput())
{
byte[] buffer = new byte[2048];
int bytes;
while ((bytes = stdin.Read(buffer, 0, buffer.Length)) > 0)
{
stdout.Write(buffer, 0, bytes);
}
}
}
}
}
我需要一个例子在c++中与APIENTRY winMain() -启动函数。谢谢。
找到答案了。谢谢Pete。
HANDLE thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)CreateAppThread, (LPVOID)NULL, 0, NULL);
线程函数 BOOL CreateAppThread()
{
hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
hStdin = GetStdHandle(STD_INPUT_HANDLE);
CHAR buffer [2048];
DWORD bytes_read, bytes_written;
while(ReadFile( hStdin, buffer, sizeof(buffer), &bytes_read, NULL))
{
WriteFile(hStdout, buffer, sizeof(buffer), &bytes_written, NULL);
}
return TRUE;
}
相关文章:
- C++控制台应用程序阻止退出
- 如何在 Win32 C++控制台应用程序中调用 UWP 类库
- 是否可以从控制台应用程序使用 C++/WinRT 创建窗口?
- 如何创建一个使用开源c项目的c++控制台应用程序
- c ++控制台应用程序,如何在控制台外部打印字符
- 将控制台应用程序直接输出到Visual Studio而不是外部Windows控制台中
- 如何在 Win32 控制台应用程序中注册不可见的窗口类?
- 如何将从控制台应用程序C++回调设置为C++ COM DLL
- 使用代码在 AWS 开发工具包C++控制台应用程序上设置凭证
- 直接输入控制台应用程序
- C++调试控制台应用程序
- C++控制台应用程序调用C++/CLI静态库
- 如何在控制台应用程序中添加滚动功能以显示更大的输入
- 如何在将Visual Studio C++控制台应用程序连接到Microsoft SQL Server时修复"
- 如何读取windows服务启动的控制台应用程序的输出
- VS2017 中缺少 Win32 控制台应用程序.如何创建C++空项目?
- 将 Visual C++ 6 控制台应用程序作为 Windows 服务运行
- 如何将控制台应用程序放入系统托盘通知C++?
- 如何向控制台应用程序添加图标
- 如何在 Linux/Apache 虚拟主机上运行 win32 控制台应用程序?