Results 1 to 4 of 4

Thread: Help!! Writing windowless, cyclical, server application

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    8

    Post

    I am writing an application that will run as a service on an NT server and has no user interface. The application checks for and processes new records on a cyclical basis. Since there is no user interface all code is running inside code modules. When all new records are processed I initiate a timer (through an api call) to start the process over again after a time delay.

    Main()
    Initialize system
    Call ProcessRequests
    Exit Sub

    ProcessRequests()
    Kill timer if active
    Process requests
    Set new timer that will return control to ProcessRequests() on time out.
    Exit Sub

    Unfortunately, unlike forms, the code module does not wait for an event to occur when you exit a sub routine. When ProcessRequests() exits it returns to Main() which also exits. After the program exits Main it loops back to the beginning of Main(). How to I get the program to pause until the timer completes?

    Steve

  2. #2

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    8

    Post

    Originally posted by r0ach:
    This is a long shot (and not very good advice), but it's what i would have done.

    Why not just use an empty form, and set it's visible property to false? That way, you have no interface, and your program will wait for events to occur.

    Sorry. :/

    Thanks for the reply. I realize I could make my life much simpler by using a form but I would like to do this without a form if possible. (I guess I like doing things the hard way!)

    Steve

  3. #3
    Member
    Join Date
    Feb 2000
    Posts
    43

    Post

    I've never really played with it this way... but do you have a way of checking if the timer is complete?

    then you could

    Do
    If [[the timer is complete]] then TheTimerIsComplete = True
    Loop Until TheTimerIsComplete = True

    (you would have to find some way of figuring out if the timer is complete (and setting the TheTimerIsComplete variable accordingly)

    this would loop forever until the timer is complete.

    If I am way out in left field and don't understand anything, pleeze kindly ignore me

    ------------------
    Rapmaster

  4. #4
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722

    Post

    This is a long shot (and not very good advice), but it's what i would have done.

    Why not just use an empty form, and set it's visible property to false? That way, you have no interface, and your program will wait for events to occur.

    Sorry. :/

    ------------------
    r0ach(tm)

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