Google Answers Logo
View Question
 
Q: Run a 16 bit Console Application from VB6/VB.NET ( No Answer,   0 Comments )
Question  
Subject: Run a 16 bit Console Application from VB6/VB.NET
Category: Computers > Programming
Asked by: tiewire-ga
List Price: $10.00
Posted: 12 Mar 2004 14:46 PST
Expires: 16 Mar 2004 08:36 PST
Question ID: 316127
I am working on a project that requires me to run an old 16bit
executable from within my VB.Net application.  Could someone please
help me with some code to do this?  Here are the details:

1. VB.Net application builds the source file for the old executable.
2. Then I need to run the executable.
 - The command window opens and there is a prompt for input.
3. Input the source file name.
 - After the source file name is entered and you press enter, another
prompt comes up.
4. Then Input the output file name.
5. Then the executable does its thing and generates the output file.
6. Close the old application.
...

I would prefer an answer written in VB.Net.  Any help would be greatly appreciated!

Request for Question Clarification by mathtalk-ga on 13 Mar 2004 08:38 PST
Hi, tiewire-ga:

If I were trying to do this, I would begin by experimenting with how
your 16-bit executable runs in a "DOS" box (which should actually be
referred to as a Command Shell if you're operating system is in the NT
family, ie. W2K or WinXP).

If you're lucky, then you can obtain the effect you want by input
redirection.  That is, on the command line, try something like:

C:> myOldProg  < textInput.txt

where the file textInput.txt contains just those characters which one
would ordinarily enter from the console (keyboard).  In your case that
apparently means the input "source" file name and the ouput file name
(with Enter, or CR/LF at then end of each input line).

When programs can be successfully "driven" in this manner, it is
likely possible to get them to work "behind the scenes" from VB6 or
VB.Net with a call to the Windows ShellExecuteEx API.  From a .Net
perspective one hurdle here is that this unmanaged code, so a bit of
conscious navigation is required to manage the transition from managed
to unmanaged code.

I believe the amount you've offered for this Question is not typical
of questions requiring the same amount of effort to answer well. 
Although a Researcher may take a special interest in your Question,
you might want to review the guidelines provided by Google Answers
here:

http://answers.google.com/answers/pricing.html

regards, mathtalk-ga

Clarification of Question by tiewire-ga on 16 Mar 2004 08:36 PST
Thx mathtalk

will repost.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy