Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COM Issues
Message
De
02/07/2002 10:13:06
Lloyd Grant
Meridian Legal Systems
Buxton, Royaume Uni
 
 
À
02/02/2001 20:51:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00471972
Message ID:
00674438
Vues:
18
Hi Gary,

I am running VFP with Service Pack 1 and Outlook 2000 SR-1 (9.0.0.3821) and get exactly the same message "parameter is not optional". If I step through the code then it works and deletes the contact. This behavior makes it very difficult to trace the problem. Below is the code currently. I have yet to find a reliable solution to this. Did you solve the problem, or does anyone else know what the solution is?


IF llSuccess && .T. if the search ran OK, regardless of the result
*-- Delete contact if found
IF ISNULL( loOneContact )
lnResult = NOT_FOUND_BY_OUTLOOK && Not found in Outlook
ELSE
*-- Start 13/06/2002
*-- Lloyd Grant
*-- I found that the contact was not deleted if I didn't include
*-- this WAIT WINDOW. I messed about with AutoYield and that didn't
*-- make any difference. If I traced through the code via the debugger
*-- it worked OK. I can't explain this, but the WAIT WINDOW
*-- fixes it so the contact is deleted. Very strange :/
*-- Start 02/07/2002
*-- Lloyd Grant
*-- This still does not fix it, so some code has been added to
*-- try again with some delay etc to try it a second time...

*-- Lloyd Grant
*-- End 13/06/2002

THIS.lStopOnError = .F.
THIS.lErrorOccured = .F. && Reset any error condition
loOneContact.Delete()
llSuccess = NOT THIS.lErrorOccured
THIS.lStopOnError = llStopOnError
*-- Start 02/07/2002
*-- Lloyd Grant
*-- Weird problem, somedays we can delete the contact, others we can not.
*-- Issue a sleep and see if that helps...
IF llSuccess
loOneContact = NULL
ELSE
loOneContact = NULL
THIS.lErrorOccured = .F. && Reset any error condition
loOneContact = THIS.FindContact( lcOutlookProperty, lcPropertyValue )
llSuccess = NOT THIS.lErrorOccured
*-- Another vague attempt to fix the problem, invert the autoyield
_VFP.AutoYield = NOT _VFP.AutoYield
*-- Tell VFP to do anything that is floating around
DOEVENTS
*-- Now wait a while
DECLARE Sleep IN win32api INTEGER
Sleep( 100 )
WAIT WINDOW "" NOWAIT
THIS.lErrorOccured = .F. && Reset any error condition
THIS.lStopOnError = .F.
loOneContact.Delete()
llSuccess = NOT THIS.lErrorOccured
THIS.lStopOnError = llStopOnError
IF llSuccess
loOneContact = NULL
ENDIF
ENDIF
*!* loOneContact = NULL

IF llSuccess
lnResult = CONTACT_DELETED && Found and deleted
ELSE
lnResult = CONTACT_FAILED_TO_DELETE
ENDIF
ENDIF
ELSE
lnResult = FIND_FAILED_TO_RUN
ENDIF

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform