VB - how can I write back to the console that called the program???
Results 1 to 7 of 7

Thread: VB - how can I write back to the console that called the program???

  1. #1
    Registered User CeeBee's Avatar
    Join Date
    Nov 2002
    Location
    USA
    Posts
    2,494

    VB - how can I write back to the console that called the program???

    Assume I have a program (myvb.exe) that is called from a command prompt. I need to be able to write data BACK to the command prompt - something like printf() in C. The problem is that when a vb app is called, it is being detached from the console. So how do I do it??? Something like:
    C:>myvb.exe
    Hello World!
    C:>


    Oh, and it's VB6, not the .NOT
    Last edited by CeeBee; September 8th, 2004 at 09:26 AM.
    Protected by Glock. Don't mess with me!

  2. #2
    Intel Mod Platypus's Avatar
    Join Date
    Jan 2001
    Location
    Australia
    Posts
    5,783

  3. #3
    Registered User CeeBee's Avatar
    Join Date
    Nov 2002
    Location
    USA
    Posts
    2,494
    no, that thing will open a new console, i need to write back to the console that called the app.
    Protected by Glock. Don't mess with me!

  4. #4
    Intel Mod Platypus's Avatar
    Join Date
    Jan 2001
    Location
    Australia
    Posts
    5,783
    Mmm, I half suspected that.

    I guess the problem would be that the calling console being a command prompt is pre-established in its own Virtual Machine.

    Would you be able to establish your own console process first to give the command line, then use pipes to re-direct STDOUT of the child process, as suggested by dragonsf about halfway down this post:

    http://www.google.com.au/search?q=ca...TRIBUTES&hl=en

    Edit: Oops, sorry, wrong language. Does the concept of creating a console app to provide the calling command line help? Probably not...
    Last edited by Platypus; September 8th, 2004 at 10:49 AM.

  5. #5
    Registered User CeeBee's Avatar
    Join Date
    Nov 2002
    Location
    USA
    Posts
    2,494
    Found a solution that seems to be working
    http://www.experts-exchange.com/Prog...6.html#8272025
    Protected by Glock. Don't mess with me!

  6. #6
    Intel Mod Platypus's Avatar
    Join Date
    Jan 2001
    Location
    Australia
    Posts
    5,783
    You can find some good stuff on experts-exchange, especially since they put the hyphen in.

  7. #7
    Registered User CeeBee's Avatar
    Join Date
    Nov 2002
    Location
    USA
    Posts
    2,494
    After all it didn't work as I expected. Even if it writes back to the console, when I'm calling it from my web server it doesn't respond with any data (also trying to pipe the output to a text file results in 0 bytes written). I ended up installing VB.NET Express and doing a console project which is now being supported by default (and it works...)
    Protected by Glock. Don't mess with me!

Similar Threads

  1. Help With a VB ASCII Program
    By pitlord2 in forum Programming And Web Design
    Replies: 0
    Last Post: April 22nd, 2004, 04:44 PM
  2. busy work
    By ilovetheusers in forum Tech Lounge & Tales
    Replies: 6
    Last Post: July 23rd, 2002, 03:04 PM
  3. [RESOLVED] Dos write back?
    By maxpace in forum DOS
    Replies: 3
    Last Post: September 7th, 2001, 09:55 PM
  4. [RESOLVED] launching external program from VB
    By ibennetch in forum Programming And Web Design
    Replies: 2
    Last Post: July 9th, 2001, 08:08 PM

Bookmarks

Posting Permissions

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