Results 1 to 9 of 9

Thread: [2005] windows app to console app

  1. #1

    Thread Starter
    Hyperactive Member pgag45's Avatar
    Join Date
    Mar 2007
    Location
    Colorado
    Posts
    262

    [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

  2. #2
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    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

  3. #3

    Thread Starter
    Hyperactive Member pgag45's Avatar
    Join Date
    Mar 2007
    Location
    Colorado
    Posts
    262

    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?

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    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

  6. #6

    Thread Starter
    Hyperactive Member pgag45's Avatar
    Join Date
    Mar 2007
    Location
    Colorado
    Posts
    262

    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

  7. #7
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    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

  8. #8

    Thread Starter
    Hyperactive Member pgag45's Avatar
    Join Date
    Mar 2007
    Location
    Colorado
    Posts
    262

    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!

  9. #9
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    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
  •  



Click Here to Expand Forum to Full Width