Re: basic console app without .net, is it possible in c#.
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Sun, 3 Feb 2008 11:12:43 +0100
"Arne Vajhøj" <arne@xxxxxxxxxx> wrote in message news:47a53135$0$90272$14726298@xxxxxxxxxxxxxxxxxx
Willy Denoyette [MVP] wrote:"Arne Vajhøj" <arne@xxxxxxxxxx> wrote in message news:47a3d994$0$90270$14726298@xxxxxxxxxxxxxxxxxxWilly Denoyette [MVP] wrote:Anyways, there is no real way to build *console* applications in VB6.
Depends on your definition of real.
Use of FSO and link /edit /subsystem:console can
actually produce a console app.
Well, you are cheating :-), but this is not exactly my definition of a console application.
My definition of a console application:
- does not depend on a GDI, that is, creates no Window and (obviously) does not pump a Windows message queue.
- takes his user input from the keyboard (stdin) and sends it's output to a command shell window (stdout).
I don't think that VB6 can create such an application, flipping the console bit in the PE header doesn't help to achieve the above, isn't it?
FSO and flipping the bit help.
Sub Main()
Dim fso As Scripting.FileSystemObject
Dim instm As Scripting.TextStream
Dim outstm As Scripting.TextStream
Dim s As String
Set fso = New Scripting.FileSystemObject
Set instm = fso.GetStandardStream(0)
Set outstm = fso.GetStandardStream(1)
outstm.Write "Enter something: "
s = instm.ReadLine
outstm.WriteLine "You entered: " & s
End Sub
sure quacks like a duck.
Arne
I know that flipping the bit, enables the stdin/stdout in the process, so you can redirect both handles to whatever you see fit. The problem is that you can't get rid of the Form (the Window and it's message queue), or do you have found a means to call Main before the window gets created?
Willy.
.
- Follow-Ups:
- Re: basic console app without .net, is it possible in c#.
- From: Arne Vajhøj
- Re: basic console app without .net, is it possible in c#.
- References:
- Re: basic console app without .net, is it possible in c#.
- From: Willy Denoyette [MVP]
- Re: basic console app without .net, is it possible in c#.
- From: Rene
- Re: basic console app without .net, is it possible in c#.
- From: Willy Denoyette [MVP]
- Re: basic console app without .net, is it possible in c#.
- From: Arne Vajhøj
- Re: basic console app without .net, is it possible in c#.
- From: Willy Denoyette [MVP]
- Re: basic console app without .net, is it possible in c#.
- From: Arne Vajhøj
- Re: basic console app without .net, is it possible in c#.
- Prev by Date: Re: Function minimization and random numbers
- Next by Date: This program is not thread safe and cause run time error in debug mode
- Previous by thread: Re: basic console app without .net, is it possible in c#.
- Next by thread: Re: basic console app without .net, is it possible in c#.
- Index(es):
Relevant Pages
|
Loading