Results 1 to 3 of 3

Thread: C programmer lost Focus

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    Gloucestershire, England
    Posts
    301

    Post

    The transistion for a "concieved to be" hard lanuage like C to one like Basic is harder than I thought!

    I am a bit confused by where the "focus" of the program is at any given moment. In C from when I start i.e

    void main(void)
    {
    do this
    then do this
    then wait here untill event X happens
    }

    I always know where the program is and what its doing.

    One of my main questions is where does the program start from? As far as I can tell the program "starts" in the Private Sub Form_Load() of my main form.

    From here I am calling my functions as if this was main(void) in C. Is this the right thing to do?

    Thanks

  2. #2
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386

    Post

    Hehe post this on some C newsgroups too to show VB isn't that easy as they always think *LOL*
    but anyway, depends on what functions you want to perform.
    Something happens in VB when the event is raised, eg., you want to save a file with info the user just typed, you usually put that code in a command_click event (cmdSave would be an obvious name).
    In other cases, where the program "just has to do certain tasks", I think the form_load is a good place to put them. At least, you always put initialization code in there.
    Or, drop a command button (cmdStart) on the form, and let the user click on that button when they want to start the task.
    If you want more info, be some more specific about what your program is supposed to do.

  3. #3
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355

    Post

    basically, in vb the message handling is done for you
    In that way VB is kinda like MFC, in that it maps messages to events (command1_click). The good thing about vb, though, is that if u want you can send messages and handle messages yourself, if you need to do something very specific.
    You can start your app at form_load or at
    Sub Main - go to project settings to change it. Sub main is good if your have a lot of forms, some which you may not want to load at startup.

    ------------------
    cintel rules
    www.cintelsoftware.co.uk

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