As I said about FTP.EXE, many console programs do I/O against the Console Device and don't use Std I/O streams at all. There are both high and low level I/O APIs that can be used to conduct conversations via one or several screen buffers.
I'm not aware of any technique to "hook" these API calls for a given process. Even if you could it would probably require that you implement most of the available functionality in order to get everything to work right.
I have an ActiveX DLL I wrote that is used to give a CScript (typically written in VBScript) access to a custom screen buffer that is divided into various "panels" to provide a sort of GUI interface within a console window (or full screen). The result is a lot like a VBDOS application. No way this I/O is going to be intercepted via pipes - it isn't routed via any stream file such as stdin/stdout at all.
I can't think of any trick to embed as console window as a VB control within a VB form. The best thing you have is to allocate a console and let the user interact with that (separate) window.
strongm's comment in the thread referenced above discusses the topic I mentioned earlier: creating a VB program that interacts with a console via Std I/O streams. Such programs
can be redirected via anonymous pipes. I'm not sure how that gets you anywhere toward your goal though.
I can't imagine how doing "this" in .Net buys you anything at all either. True, it is easy to write a VB.Net console program, but it is pretty trivial in VB anyway:
modMain.bas
Code:
'Requires a reference to Microsoft Scripting Runtime.
Sub Main()
Dim FSO As New Scripting.FileSystemObject
Dim sin As Scripting.TextStream
Dim sout As Scripting.TextStream
Dim strWord As String
Set sin = FSO.GetStandardStream(StdIn)
Set sout = FSO.GetStandardStream(StdOut)
sout.WriteLine "Hello!"
sout.WriteLine "What's the word?"
strWord = sin.ReadLine()
sout.WriteLine "So, the word is " & strWord
Set sout = Nothing
Set sin = Nothing
End Sub
You compile the program and then edit the EXE using any of several techniques. I like to use a short WScript:
LinkConsole.vbs
Code:
Option Explicit
'LinkConsole.vbs
'
'This is a WSH script used to make it easier to edit
'a compiled VB6 EXE using LINK.EXE to create a console
'mode program.
'
'Drag the EXE's icon onto the icon for this file, or
'execute it from a command prompt as in:
'
' LinkConsole.vbs <EXEpath&file>
'
'Be sure to set up strLINK to match your VB6 installation.
Dim strLINK, strEXE, WSHShell
strLINK = _
"""C:\Program Files\Microsoft Visual Studio\VB98\LINK.EXE"""
strEXE = """" & WScript.Arguments(0) & """"
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.Run _
strLINK & " /EDIT /SUBSYSTEM:CONSOLE " & strEXE
Set WSHShell = Nothing
WScript.Echo "Complete!"
Voila! A simple VB program that can be run from a console and interact in character mode. No API calls required at all.