如何在 VB6 中读取子进程的标准输出?
在 VB6 中创建进程时(与 这个问题:),我使用以下结构:
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
在开始我的流程之前,需要对 STARTUPINFO.hStdOutput 进行哪些操作才能让我的 VB6 应用程序读取托管流程的输出?
谢谢!!
When creating a process in VB6 (related to this question:), I'm using the following struct:
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Before I start my process, what needs to happen to STARTUPINFO.hStdOutput in order for my VB6 app to read the output of my hosted process?
Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
跟进这个其他问题OP,我发布了一种替代方法来执行命令并获取标准输出:
Following up this other question by the OP, I post an alternative method to execute a command and get hold of stdout:
Microsoft 在此处提供了有关如何执行此操作的示例。
Microsoft gives here an example on how to do it.
请参阅
AttachConsole(ATTACH_PARENT_PROCESS)
See
AttachConsole(ATTACH_PARENT_PROCESS)