Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get VFP OLE Server to use error procedure
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00097111
Message ID:
00097403
Views:
25
>>>>>>>You can't do any screen IO from a VFP Server. You'll need to write the information to the error log.
>>>>>>
>>>>>>Thanks for responding Craig.
>>>>>>
>>>>>>Actually I am using a MessageBox call and I got it to work with very basic information. It still manages to go back to the VFP message. Now I have to figure out how to get the class to release without returning to the method that called the error.
>>>>>
>>>>>
>>>>>Look at RETURN TO MASTER or maybe QUIT.
>>>>
>>>>Thanks again Craig!
>>>>
>>>>Been there done that.
>>>>I tried the xBase legacy 'RETURN TO MASTER'. And QUIT results in the ubiquitous 'Cannot Quit FoxPro' I tried 'ON SHUTDOWN'...nada.
>>>>
>>>>I have set up the release procedure to return -1. I am calling this from a Delphi app. Everything works fine except when I raise an exception within the server code.
>>>>
>>>>I have an Error Procedure in the class and all it does is go there when there is an error and return to the class that had the error, only to show me the VFP default message. I get my message first then the VFP message. It is nerve racking! All I want is for the error method to return to the calling program a -1 and quit. < heavy sigh >
>>>
>>>Maybe I'm missing something but what about
>>>in the init of the form I
>>>errorflag=.f.
>>>on error errorflag=.t.
>>>then
>>>do your code
>>>then
>>>if errorflag=.t.
>>> error stuff method
>>>else
>>> other code
>>>endif
>>>This way works for me.
>>>HTH
>>>Jeff
>>
>>What happens if you get an error on the "USE" command in the following code:
>>
>> Use MyTable
>> MyVar = MyTable.MyField.
>>
>>Also, if you do a select but for some reason the app can't find a table in the from clause, it will pop-up a locate window, which is very poor behavior for an unattended process.
>>
>>- Mark
>
>
>errorflag gets set to .t. nothing else happens as far as messages. If you set the on error before opening any data.
>
>Jeff

hmmm, that seems pretty solid! thanks for the clarification.
----------
Mark Bucciarelli
Previous
Reply
Map
View

Click here to load this message in the networking platform