I was getting one of those very elusive GPF-type crashes. It
seemed like the bug could be in the VB program that was
calling the DLL. Or it could be some new lines of code that I
had just added. A likely cause for that type of error could
have been an array somewhere being referenced out of bounds, or
invalid pointer usage. But after narrowing it down, I found
that passing an empty string ("") to a routine that takes
an ASCIIZ argument causes a "Subscript / Pointer out of range"
error (error #9) when the argument is used. I didn't see
anything in the documentation or forums which would explain why
this happens. Try the following code, and ERR returns error #9.
In the actual DLL component, it crashed in a totally unrelated
area of code, and it was pretty tricky to track down.
------------------
Daniel Corbier
UCalc Fast Math Parser
http://www.ucalc.com
seemed like the bug could be in the VB program that was
calling the DLL. Or it could be some new lines of code that I
had just added. A likely cause for that type of error could
have been an array somewhere being referenced out of bounds, or
invalid pointer usage. But after narrowing it down, I found
that passing an empty string ("") to a routine that takes
an ASCIIZ argument causes a "Subscript / Pointer out of range"
error (error #9) when the argument is used. I didn't see
anything in the documentation or forums which would explain why
this happens. Try the following code, and ERR returns error #9.
Code:
$Compile Exe $Debug Error On Sub Test(Arg As Asciiz) Temp$ = UCase$(Arg) MsgBox Str$(Err) End Sub Function PbMain As Long Call Test("") End Function
area of code, and it was pretty tricky to track down.
------------------
Daniel Corbier
UCalc Fast Math Parser
http://www.ucalc.com
Comment