Handling OCX errors in VFP (FoxPro) -
i have ocx can cause "internal application error" when calling 1 of it's methods in vfp9.
i've tried using on error , try/catch. both, instead of getting error, microsoft visual forpro has encountered problem , needs close.... send error report/don't send dialog.
this code looks like.
on error code (note never see wait window):
local lconerror public glerrorresult glerrorresult = .f. lconerror = on('error') on error glerrorresult = .t. this.oocxcontrol.method() if glerrorresult wait window 'error' endif on error &lconerror release glerrorresult
try/catch code (again, never see wait window):
local oerror exception try this.oocxcontrol.method() catch oerror when .t. wait window 'error' endtry
is there else try handle error prevent app crashing?
so have misbehaving ocx control. i'll assume you've considered options replacing vendor's control, or checking updates. far being able handle error, i'm not aware of can haven't tried. sounds control such deviant destroying vfp's ability continue executing.
consider how you're using control , places may breaking manufacturer's rules. places might encouraging control leak memory. odds there problem building in control bursts when hitting line of code.
for example, had experience old grid control has memory limits. if trying add many items grid, didn't throw error, instead appeared leak memory vfp's processing space , take app down. simple answer not try add ton of items grid.
Comments
Post a Comment