[2005] windows app to console app
Hello all,
I'm sure this has been asked before, but I had trouble finding a clear answer after some searching...
I'm attempting to convert a 2005 .Net Project from a windows app to a console app with the startup object being the user_form. However, where is the entry point to this form when being called from the console?
Would it be Form1_Load ? Also, coming from C and Java, how do the args come in? as an array or just a gigantic string? I thought in earlier VB's it was just a big string, but I am unsure in .net 2005
thanks much,
Paul
Re: [2005] windows app to console app
Out of curiosity, why do you want a console app, that uses a form as the start up object?
Re: [2005] windows app to console app
I'm new to VB.net, and acquired a project where a majority of the code is within the form itself, so I was hoping I could just pass some arguments to a method in the form and that code would execute...
but would the form appear if its the start up object?
Re: [2005] windows app to console app
you don't want a console app... that's for running the app in a Window-less environment. If you need command line arguments... then you should be able to get to them using my.Application.CommandLineArgs
-tg
Re: [2005] windows app to console app
So you don't want the form to show, but you want access to the methods within the form?
Re: [2005] windows app to console app
Quote:
Originally Posted by wild_bill
So you don't want the form to show, but you want access to the methods within the form?
thats correct... and I essentially want to pass in the data through arguments that were originally being passed in through the gui
Re: [2005] windows app to console app
I would cut the code you need out of the form, and place it in a class library, then reference this library with both the Windows app, and the Console app. Reusable code is cool!
Re: [2005] windows app to console app
hmm.. yeah I was hoping I wouldn't even have to grasp an understanding of this code because its very convoluted and confusing. More so I could just replace
txtInput.text with arg[1] or something to that effect and be on my way, but seems like I'm going to have to attempt to actually make sense of this thing.
thanks much for the help!
Re: [2005] windows app to console app
You probably won't have to dig very deep, find all methods that don't have an event handler, move them to your Library. Go through the remaining event handler methods, and move any business logic to your new library.