Inconsistent GPV after PopUpMenu.show() and after fileBrowserEx()

38 views
Skip to first unread message

Randall Haines

unread,
Apr 21, 2025, 11:44:54 AMApr 21
to TheDBCommunity
Hello All,

Hoping some of you may have seen this too, and have a fix.
For a few years now we have been inconsistently seeing a GPV after calling PopUpMenu.show() and fileBrowserEx().  Specifically the GPV occurs after the PopUpMenu selection is made by the user.  In the case of the FileBrowser it occurs after the user clicks ok or cancel in the FileBrowser dialog.  It seems the longer a user holds the PopUpMenu or FileBrowser open before making a selection, the more likely a GPV will occur.  

P9 SP3
Thanks for your help,
Randy Haines

Jure Zorko

unread,
Apr 22, 2025, 7:24:50 AMApr 22
to TheDBCommunity
I had problems with popupmenu.show() if menu was to long or user did not select anything.
Then program would often GPV.

I found, that best solution is to create new method in a library, that shows popup menu.
In that case paradox does not GPV.

So I have a library showpop.lsl with only one method:
method ShowPopUpMenu(var m PopUpMenu) String
var s string
endVar
s = ""
   try
    s = m.Show()
   onFail
    s = ""
   endTry
   if not s.isAssigned() then s = "" endIf
   if s.isSpace() then s = "" endIf

return(s)
endMethod

The I use this method.

Instead of:
var m PopUpMenu
   and string
endVar
  m.addText("a")
  m.addText("b")
  ans = m.Show()

Now I use
var m PopUpMenu
   ans string
  l library
endVar
  m.addText("a")
  m.addText("b")
  l.open("showpop")
  ans = l. ShowPopUpMenu(m)


Maybe you can try the same with FileBrowser.
Move it to separate library.

I use this code for selecting files:
fbi.Title =  "Choose file"
stFilter = "All files|*.*||"
fbi.CustomFilter = filter
stPath = ":WORK:"
addAlias("OpenFile", "Standard",  stPath )
fbi.Alias = "OpenFile"
if fileBrowser(fName,fbi) then
if  fName.isSpace() then
removeAlias("OpenFile")
return( fName)
endIf
if getAliasPath(fbi.Alias)<>"" then
stPath = getAliasPath(fbi.Alias)+"\\"
else
stPath   = fbi.Alias
endif
fName  =  stPath   + fbi.Path+ fName
removeAlias("OpenFile")

Jure

Randall Haines

unread,
Apr 22, 2025, 2:33:58 PMApr 22
to TheDBCommunity
Thank you Jure!  I'll give it a try soon and post back my results.

Randy

Jure Zorko

unread,
Apr 23, 2025, 3:17:35 AMApr 23
to TheDBCommunity
Sometimes I also set default printer in a BAT file, before opening Paradox.
RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "Doro PDF Writer"
This way, I do not have to change priner inside Paradox, I always create PDF and then execute
PDFtoPrinterSelect.exe c:\temp\report.pdf "HP Laser Jet xyz"
or send it via mail.

Randall Haines

unread,
Apr 26, 2025, 6:48:47 PMApr 26
to TheDBCommunity
Thanks for suggestion Jure, but my issue was not resolved with the library approach.
The good news is I did find the steps to reproduce the GPV consistently every time with both FileBrowser and PopUpMenu.

To reproduce the GPV, the following  conditions must exist:
  • A timer() must fire while the PopUpMenu or FileBrowser is being displayed.
  • A library must be opened from the timer() code, or by a custom method within the timer() code (any library, even a new blank one).  
My workaround is to never open libraries within a timer() event or call custom methods from timer() that open a library.

You can safely use custom methods from a library within the timer() if the library is already opened outside outside of the timer().

Hope this helps someone else.

Randy
Reply all
Reply to author
Forward
0 new messages