473,397 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

VB.net 2003 - Converting a GUI-ed App into a Command-Line App

140 100+
Hi,

I'm just starting an effort of converting a couple GUI front ended apps into Command line apps. Can anyone give me the conceptual process to go about this?
Expand|Select|Wrap|Line Numbers
  1. Public Class Form1
  2.    Inherits System.Windows.Forms.Form
  3.  
  4.    Public Shared Sub Main (ByVal args() As String)
  5.       'Do stuff
  6.    end sub
  7. end class
  8.  
Sub Questions:
- I'm assuming that I'll come up with an arbitrary ordering of the GUI inputs, so that the new program will look something like "CommandApp.exe Var1 Var2, ..."; is this a good assumption?
- How would a Listbox (on the GUI) be converted to a command line argument? Would each line be a new argument, or is there some character I'd place to seperate the variables?

Thanks,
Sitko.
Oct 3 '07 #1
9 1868
RedSon
5,000 Expert 4TB
Hi,

I'm just starting an effort of converting a couple GUI front ended apps into Command line apps. Can anyone give me the conceptual process to go about this?
Expand|Select|Wrap|Line Numbers
  1. Public Class Form1
  2.    Inherits System.Windows.Forms.Form
  3.  
  4.    Public Shared Sub Main (ByVal args() As String)
  5.       'Do stuff
  6.    end sub
  7. end class
  8.  
Sub Questions:
- I'm assuming that I'll come up with an arbitrary ordering of the GUI inputs, so that the new program will look something like "CommandApp.exe Var1 Var2, ..."; is this a good assumption?
- How would a Listbox (on the GUI) be converted to a command line argument? Would each line be a new argument, or is there some character I'd place to seperate the variables?

Thanks,
Sitko.
There are two ways a command line application can get input from the user. First you can pass a list of params when the user invokes the exe. (ie myProgram.exe /a /b /c param1 param2 param3) The other way is to get input from the user after a prompt. If you have a complex gui you will likely have to use a combination of these techniques. As for a listbox, you app will need to print out a list of items that would normally appear in the listbox then ask they user to select one from the list.
Oct 3 '07 #2
sitko
140 100+
There are two ways a command line application can get input from the user. First you can pass a list of params when the user invokes the exe. (ie myProgram.exe /a /b /c param1 param2 param3) The other way is to get input from the user after a prompt. If you have a complex gui you will likely have to use a combination of these techniques. As for a listbox, you app will need to print out a list of items that would normally appear in the listbox then ask they user to select one from the list.
Actually, I need to make the entire app command line driven, there is no interactivity options in this situation. The listbox will contain a list of files to access, not a choicelist where the user picks one from that list.
Oct 4 '07 #3
RedSon
5,000 Expert 4TB
Actually, I need to make the entire app command line driven, there is no interactivity options in this situation. The listbox will contain a list of files to access, not a choicelist where the user picks one from that list.
A command line can still be interactive. If it is such a thing where once the exe is started there can be no user interaction, then all inputs must be given at the time the exe is first started. So if you have some kind of choice that can be made in the gui, the user must make that choice before hand.
Oct 4 '07 #4
sitko
140 100+
A command line can still be interactive. If it is such a thing where once the exe is started there can be no user interaction, then all inputs must be given at the time the exe is first started. So if you have some kind of choice that can be made in the gui, the user must make that choice before hand.
Yeah, my current thinking is to create a textfile with all the GUI elements inputs in it, and then read it in in the program, at runtime.

We're converting this to sit behind some third party encapsulation system. Where the user will open up that apps "thin client", to put some of the inputs in, that app will create the text file, which would be fed to the VB.net app, sitting behind the scene.

Any tips or thoughts would be appreciated as this is the first time I've done something like this, and if anyone had any "watchouts!" that would be very cool.

Thanks,
Sitko.
Oct 17 '07 #5
RedSon
5,000 Expert 4TB
Yeah, my current thinking is to create a textfile with all the GUI elements inputs in it, and then read it in in the program, at runtime.

We're converting this to sit behind some third party encapsulation system. Where the user will open up that apps "thin client", to put some of the inputs in, that app will create the text file, which would be fed to the VB.net app, sitting behind the scene.

Any tips or thoughts would be appreciated as this is the first time I've done something like this, and if anyone had any "watchouts!" that would be very cool.

Thanks,
Sitko.
If you are going to be redesigning an application anyway you might want to consider changing your entire design paradigm. If you are looking to write an interface to your design then it sounds like you are trying to create a Model-View-Controller.

It might help if you made this design goal formal for your project. Here is some more information about it. http://en.wikipedia.org/wiki/Model-view-controller
Oct 17 '07 #6
sitko
140 100+
If you are going to be redesigning an application anyway you might want to consider changing your entire design paradigm. If you are looking to write an interface to your design then it sounds like you are trying to create a Model-View-Controller.

It might help if you made this design goal formal for your project. Here is some more information about it. http://en.wikipedia.org/wiki/Model-view-controller
That does look like what were doing. The third party framework in this case is called EASA, you can check them out at: http://www.easasoftware.com/

Unfortunately, I can't start from scratch, I need to use the VB.net app as is, and convert it to commandLine-ish format.

I going through the code right now and converting all the references to txtboxes, or other GUI items to variables. Assuming that there will be a input text file, and assuming I have to use this app as a framework, do I just create the variables, comment out all the GUI bits, and create a Load_Data subroutine which loads the variables at the beginning of the app?

Thanks,
Sitko.

ps. it helps me to just run stuff by people even if I think I've figured something out...thanks for being a sounding board... :)
Oct 17 '07 #7
RedSon
5,000 Expert 4TB
I going through the code right now and converting all the references to txtboxes, or other GUI items to variables. Assuming that there will be a input text file, and assuming I have to use this app as a framework, do I just create the variables, comment out all the GUI bits, and create a Load_Data subroutine which loads the variables at the beginning of the app?

Thanks,
Sitko.

ps. it helps me to just run stuff by people even if I think I've figured something out...thanks for being a sounding board... :)
Yea, I mean, I guess that sounds like a good solution. That is if you can determine all the inputs before you run the application. If you have access to the source why can you not just take all the parts out that you need and start an MVC project with them? That way you will be able to put any type of view you want to on it: GUI, command line, touch pad, mouse movements, morse codes, DTMF tones, anything really.
Oct 17 '07 #8
sitko
140 100+
Yea, I mean, I guess that sounds like a good solution. That is if you can determine all the inputs before you run the application. If you have access to the source why can you not just take all the parts out that you need and start an MVC project with them? That way you will be able to put any type of view you want to on it: GUI, command line, touch pad, mouse movements, morse codes, DTMF tones, anything really.
Sorry to ask a dumb question, but what is MVC? Microsoft Visual C(++)?
Oct 26 '07 #9
RedSon
5,000 Expert 4TB
Sorry to ask a dumb question, but what is MVC? Microsoft Visual C(++)?
http://en.wikipedia.org/wiki/Model-view-controller
Oct 26 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: JNY | last post by:
Hi, I'm using a GUI Edit box to allow the user to enter a number. This data is stored as an AnsiString. I need it in Integer format, but cannot convert between the two. I found...
1
by: Matt Alanzo | last post by:
On another newsgroup an Access knowledgable party posted: >You should be able to connect an Access ADP to an existing SQLExpress >database running in SQLS 2000 compatibility mode. The only thing...
2
by: Jeff | last post by:
Does anyone know of any potential problems running a 2000 database with 2003? Also, what about installing all other Office products as 2003 versions but leaving Access as 2002 running a 2000...
9
by: Edward Diener | last post by:
I received no answers about this the first time I posted, so I will try again. My inability to decipher an MSDN topic may find others who have the same inability and someone who can decipher and...
4
by: Bob Garbados | last post by:
We have some 1.1 sites developed in dreamweaver and we will be developing all new sites for the 2.0 framework when it's out of beta. We just purchased an ms subscription and will be using visual...
1
by: jm | last post by:
I have created several VB .NET web applications and will soon have to start building "real" executables. This may be involved, but how much conversion is in a path like this? Is it simply...
5
by: Charles Law | last post by:
Does anyone know how to convert a VB.NET 2005 project file back to 2003? Are there any other files that need converting? TIA Charles
7
by: Coleen | last post by:
Does anyone have any good detailed information on the conversion process? We are in the process of converting 2 projects from 2003 to 2005 and have some conversion errors that I can not find...
3
by: Jef Driesen | last post by:
How can I convert a date string to a number (e.g. a time_t value or a tm struct)? I know about the strptime function, but then I have to know the format string. And that is a problem. I'm trying...
3
by: NEWSGROUPS | last post by:
I am in the midst of trying to convert about 25 Access 2000 to Access 2003. The new environment consists of Office/Access 2003 and Outlook 2003. When converting the back ends I have no problems....
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.