Author Topic: WPF Message Boxes in QB64 Part Deux  (Read 3460 times)

0 Members and 1 Guest are viewing this topic.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
WPF Message Boxes in QB64 Part Deux
« on: May 08, 2020, 12:04:06 pm »
A few (maybe several) months ago I introduced WPF Message Boxes for QB64 as either a forum post or a post to the QB64 Github. I think it is lost to the wind, now. Since then, I've made many changes to it and have gotten it to the point now where it can be a beautiful little replacer for the standard error messages that QB64 gives for invalid handle and whatnot (see attached screenshot).
 
bsod message.png

I've updated my code to handle all the defined errors listed on https://www.qb64.org/wiki/ERROR_Codes and show a "fake BSOD" message like the attached with the error code, details, and the website to see more info. Pressing Yes will allow the program to attempt to continue just like the old messages did. Pressing No currently calls SYSTEM to shut the program down rather than using END. (I'm not a fan of using END. I like SYSTEM better.)
The below code is used in the main module of your program near the top. Any defined error should call the message box function that I made and show you a pretty, always-on-top message box.
Download all the attached files and '$INCLUDE WPFMessageBox.BI at the top and WPFMessageBox.BM at the bottom of your programs. New-WPFMessageBox.ps1.bin.bas is a file already '$INCLUDEd in WPFMessageBox.BI and creates the New-WPFMessageBox.ps1 at runtime if it doesn't already exist. My Github page for this project is located at https://github.com/SpriggsySpriggs/WPFMessageBoxQB64 and I update it as frequently as I can.
Code: QB64: [Select]
  1. ON ERROR GOTO ERRHANDLE
  2. ERRHANDLE:
  3.         CriticalError ERR, _INCLERRORLINE, _INCLERRORFILE$
  4.         RESUME NEXT
  5.     ELSE
  6.         CriticalError ERR, _ERRORLINE, ""
  7.         RESUME NEXT
  8.     END IF
« Last Edit: May 08, 2020, 12:51:55 pm by SpriggsySpriggs »
Shuwatch!

FellippeHeitor

  • Guest
Re: WPF Message Boxes in QB64 Part Deux
« Reply #1 on: May 08, 2020, 12:08:49 pm »
That's cool! Thanks for sharing it, Spriggsy!