Results 1 to 5 of 5

Thread: Standard Output

Hybrid View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2002
    Location
    London
    Posts
    31

    Standard Output

    Hi,

    does anyone know if you can write to standard output using Visual Basic ?

    (in the way you do with java, ie system.out.println("blah")

    I know how to create a console window, but would prefer to be able to update the same window that the program was run from (ie command prompt window)

    And suggestions would be greatly appreciated!!

    Zinedine!!

  2. #2
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    VB Code:
    1. Private Sub Form_Load()
    2.     MsgBox "blah"
    3.    
    4.     'or
    5.    
    6.     Text1.Text = "blah"
    7. End Sub
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2002
    Location
    London
    Posts
    31
    no, I mean printing to the DOS prompt or command prompt - not to form controls or message boxes!!

    (thanks for the response though)


  4. #4
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    To write to Standard Output, use the GetStdHandle APi call to get a handle to it, then use the WriteFile API to write to the handle.

    However, to be able to correctly write to STDOUT when run from a command prompt, you need to binary patch your compiled .exe - a mkconsole utility is here (you do not need this patch in a CGI environment, etc):
    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.

  5. #5
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602
    I could use some help from anyone who knows stdout on the lower level.
    I have written a vb app as a console application and patched it. When I fun it from command line in winxp it works fine (output text and returns with an exit code) but when we try to run it with Enterprise ControlStation (A program that schedules and launches programs) it doesn't detect any sysout what so ever from the application. When running a REXX or C++ program with ECS it works fine. Is it possible that the sysout is put somewhere else when using kernel32 apis in vb to srite to stdout?


    Anyone know any tricks I can try?


    kind regards
    Henrik

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