Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB on command line?

Status
Not open for further replies.

sagn

Programmer
Jun 7, 2001
166
US
Hi,

I have been charged with the task of taking a code
written in VB (heavy GUI), and creating a .exe that
can be run at the DOS prompt.

Is this possible? I realize I would have to 'unwrap'
the 'functional' part. I worry, though, because
it seems to me that the whole point of VB is the GUI.

Can one write a Main, or example, without using forms?

Thanks

diane
 
Yes, one can. However as you correcty observe the whole (original) point of VB is the GUI. As such VB deliberately severs all connection with the command line.

So, whilst is is possible to launch a VB program from a 'DOS prompt', and for that program to consist of a formless Main, there is no easy way to get any output back to the launching 'DOS prompt'.

What you are looking for is what is known as a 'console application' and VB (up to version 6) cannot produce them*. VB.NET can


* A keyword search in forum222 should reveal a couple of threads where I have provided some workarounds that allow a) read/write access to a command prompt and b) allows VB to work as a console app (this latter is a horrendous hack, rewriting as it does part of the Portable Executable header...)


 
Thank You Very Much.

I will look at that forum immediately.

diane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top