• Welcome, Guest. Please login.
May 07, 2021, 11:40:05 PM


Welcome to the SQLitening support forums!

Why won't a MSGBOX in a SQLiteningProc Fn work?

Started by Bern Ertl, July 22, 2009, 11:45:13 AM

Previous topic - Next topic

Bern Ertl

If I try putting a MSGBOX in a function in an SQLiteningProc DLL, the function hangs/errors out when it reaches that point of the code (ie. the MSGBOX causes the hang/error).  I'm having to write code to exit the function with data in one of the string parameters to check client side as part of the debugging process, but it would be much easier if I could use a MSGBOX.  Any idea why it doesn't work?

David Kenny


I don't have any thoughts on the msgbox problem itself.  But I dropped msgbox as a trouble shooting tool when Patrice Terrier released his ztrace.dll.

Now, any program I need to debug, I include this declaration:
Declare Function zTrace Lib "zTrace.DLL" Alias "zTrace" (zMessage As Asciiz) As Long

And anytime I need to observe a variable I use something like one of these:
ztrace "sDriveLetter =" & Left$(sPath,2)
ztrace "Entered CalcTotals function"
ztrace "lReturn =" & Str$(lReturn)

The benefits include: easy to use, doesn't slow execution measurably, can view all the elements at one time (and in order), can copy them to the clipboard.  I'm sure I could come up with more.

You just need to put the dll in the path.  I threw it in the Windows folder.  PB 9.0 sometimes complains that the parameters don't match when using a function that returns a string.  I just use insert a ["" & ] in front of it.

Here is a link to Patrice's post on Jos? Roca's forum:

You will find the attachment at the bottom of the first post.


Bern Ertl

Fred Meier

Can't use MsgBox in a program that is running as a Service (Remote Mode).  There is no user so it just waits forever for an answer and your client will timeout.  However, you can use a MsgBox in a proc if you run it in Local Mode, be sure to remove before using in Remote Mode.