Results 1 to 8 of 8

Thread: old school -- command line executable

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Crossroads of America
    Posts
    72

    old school -- command line executable

    I'm creating a good "old fashioned" command line program: no forms, no visual interface. Just a bunch of modules and a sub main(). Reads command line options.

    Now my problem: I can't seem to find any way to return text to the console (command line interface). I want to return status information, but I can't find any functionality to do this. Basically I'm looking for the equivalent of a printf or cout...is this possible?

  2. #2
    Frenzied Member numtel's Avatar
    Join Date
    Apr 2000
    Location
    CA
    Posts
    1,163
    have you heard of qbasic? lol... no but seriously, that's probably the easiest way to go unlress there's lots of apis, if there is lots of apis then thats good you know how to use them because i takes a whole bunch to make a console app in vb. i know i've seen this tutorial somewhere, i'm lookin...

  3. #3
    Frenzied Member numtel's Avatar
    Join Date
    Apr 2000
    Location
    CA
    Posts
    1,163
    http://209.120.143.185/showthread.ph...le+application here ya go, should be what you need

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Crossroads of America
    Posts
    72
    thx for the quick reply. I *do* miss qbasic...esp the worm game. I *really* miss my unix days...writing code in vi, command line c compiler...good old days.

    I figured there might not be an easy way to do this...oh well. Price of progress.

  5. #5
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032

    Re: old school -- command line executable

    Originally posted by DaveAMS
    I'm creating a good "old fashioned" command line program: no forms, no visual interface. Just a bunch of modules and a sub main(). Reads command line options.

    Now my problem: I can't seem to find any way to return text to the console (command line interface). I want to return status information, but I can't find any functionality to do this. Basically I'm looking for the equivalent of a printf or cout...is this possible?
    If you're app is written in VB6 (or earlier, probably), and it is run from the command prompt (cmd.exe), you need to binary patch your compiled executable with a utility called mkconsole.exe to get your standard output to go back to cmd.exe - use the APIs GetStdHandle and WriteFile.

    The mkconsole tool and source code are on this site - kinda hidden, look for console stuff.
    http://mvps.org/st-software/
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  6. #6
    Frenzied Member macai's Avatar
    Join Date
    Jul 2001
    Location
    Napanoch NY
    Posts
    1,228
    Can someone just write a little module with a sub and a function?

    The sub being print to commandline, and the function being read
    the commandline.
    Luke

  7. #7
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    wouldn't it be easier to just write C console instead...
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  8. #8
    Frenzied Member macai's Avatar
    Join Date
    Jul 2001
    Location
    Napanoch NY
    Posts
    1,228
    No! Besides, i don't know C, and if i were to learn a second language, it would be Delphi, not C++.
    Luke

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width