Scott,
>I've tried to trap the error and VFP 8 just throws up all over me and then throws me out to boot! VFP terminates!
Have you tried adding SET STEP ON to the code right before the line executes? Sometimes that works better than setting a breakpoint.
Although I'm not exactly sure what's going on here, I have an alternate method of handling a single instance of a form. You can add the following code to the top of your DoForm() function in Utility.prg:
FUNCTION DoForm(tcClassName,tuParm1,tuParm2,tuParm3,tuParm4,tuParm5,tuParm6,tuParm7)
LOCAL loObject
IF TYPE("goApp.oForms") == "O"
LOCAL loForm
loForm = goApp.oForms.Get(tcClassName)
IF TYPE('loForm') == "O" AND !loForm.lallowmultipleinstances
loForm.Show()
RETURN .T.
ENDIF
ENDIF
This code simply sets focus to an existing instance if someone tries to launch a second instance.
Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com