|
-
Sep 19th, 2008, 11:04 AM
#1
Thread Starter
Hyperactive Member
[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
-
Sep 19th, 2008, 11:28 AM
#2
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?
That is the very essence of human beings and our very unique capability to perform complex reasoning and actually use our perception to further our understanding of things. We like to solve problems. -Kleinma
Does your code in post #46 look like my code in #45? No, it doesn't. Therefore, wrong is how it looks. - jmcilhinney
-
Sep 19th, 2008, 11:33 AM
#3
Thread Starter
Hyperactive Member
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?
-
Sep 19th, 2008, 11:46 AM
#4
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
-
Sep 19th, 2008, 11:49 AM
#5
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?
That is the very essence of human beings and our very unique capability to perform complex reasoning and actually use our perception to further our understanding of things. We like to solve problems. -Kleinma
Does your code in post #46 look like my code in #45? No, it doesn't. Therefore, wrong is how it looks. - jmcilhinney
-
Sep 19th, 2008, 11:50 AM
#6
Thread Starter
Hyperactive Member
Re: [2005] windows app to console app
 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
-
Sep 19th, 2008, 12:03 PM
#7
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!
That is the very essence of human beings and our very unique capability to perform complex reasoning and actually use our perception to further our understanding of things. We like to solve problems. -Kleinma
Does your code in post #46 look like my code in #45? No, it doesn't. Therefore, wrong is how it looks. - jmcilhinney
-
Sep 19th, 2008, 12:11 PM
#8
Thread Starter
Hyperactive Member
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!
-
Sep 19th, 2008, 12:16 PM
#9
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.
That is the very essence of human beings and our very unique capability to perform complex reasoning and actually use our perception to further our understanding of things. We like to solve problems. -Kleinma
Does your code in post #46 look like my code in #45? No, it doesn't. Therefore, wrong is how it looks. - jmcilhinney
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|