Results 1 to 3 of 3

Thread: Msgbox halting processes in unattended realtime app

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    New Orleans, LA
    Posts
    2

    Question

    I am using Msgbox() to display error messages in error traps and com port failures.

    The problem is that if an error occurs and the message box is displayed, the program is in limbo until someone hits OK.
    There is no guarranty that anyone will notice this for hours, and in the mean time I will be losing data the app is supposed to be collecting.
    This is a problem in a realtime app.

    I tried setting my project to run unattended, but since it is created as a Standard exe project, I am not allowed to select this feature. There is a bit of this that I still don't understand.

    I was going to try to log messages to the NT event log, but could not get that to work either. The MSDN help on the logevent method shows the syntax for setting the logmode property, but they go on to say that this can't be set at run time.?? then why show such syntax??

    I have seen flavors of VB scripting languages that use a time out feature on a message box, but it does not look like VB 6 has such a feature.

    Is there any way that I can work around this problem? Could I somehow kick off another (or new) thread that would be responsible for displaying the message box without hanging up the process.

    Please go slow, I am "experience challenged".

    Thanks for any input.

    [Edited by MPHymel on 08-23-2000 at 08:04 PM]

  2. #2
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    461
    Define your own msgbox as a new form and then program into it to shut itself down if nobody does anything about it for a while.

  3. #3
    Junior Member
    Join Date
    Jun 2000
    Location
    Manchester, England
    Posts
    28
    Just don't use the MsgBox function at all. Previous reply was a good suggestion (custom message box with timeout) but if there is no guarantee that anybody will see it you still need to generate a logfile. Just create a standard text file with the error number, description, where it happened etc. using Open FileName as #1 for append or similar. You can then check the log file periodically. If the network you are attached to has an Exchange Server, you could drop a RFC-822 formatted text file into the pickup directory and have it emailed to you whenever there is an error!

    Hope this is useful. Good luck.
    We watch in reverence as Narcissus is turned to a flower.

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