Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP App Crash Suppress VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01405762
Message ID:
01405792
Vues:
91
>Is there any way to prevent a VFP app, in the event of a weird crash, from showing the message Visual Foxpro has encountered an error and must now close message?
>
>It would be better if it said the name of my app instead. This is not for framework errors, but rather VFP errors wherein the entire application crashes.

You could take a look at the SetErrorMode Win32API function, which looks like it could be used to have your app handle certain serious errors rather than the OS. I haven't used it myself.

e.g. http://news2news.com/vfp/?group=25&function=366

Most VFP bugs that cause crashes are pointer errors where VFP is trying to access memory that doesn't belong to it. In addition to being incorrect and likely to make the program not work properly, illegal access attempts are classic malware behaviour. The default Windows reaction is to immediately kill the culprit dead. I'm not sure this reaction can be modified, even by something like SetErrorMode.

As for changing the reported name: I haven't had reports of my VFP apps C5'ing but ISTR that a couple of times I've seen it in person it's reported the name of my .EXE, rather than "Visual FoxPro" e.g. "LT2.exe has encountered a problem and needs to close". If you're seeing that too, one thing might be to change the name of your .EXE to SomeFriendlyNameYourUsersCanRecognize.exe.

Changing the process name Windows uses for reporting errors etc. *seems* like the sort of thing that might be changeable via something like Win32API but I have no idea where to look. Unless Windows views that as malware-like activity and prevents it.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform