Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Member DOCUMENT does not evaluate to an object
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Member DOCUMENT does not evaluate to an object
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Divers
Thread ID:
01514050
Message ID:
01514050
Vues:
341
I am using Cesar Chalom's email form & classes contained in his FoxyPreviewer code. Specifically, the class is "pr_htmledit." Periodically it will error with the message: "Member DOCUMENT does not evaluate to an object." The error appears to be occuring at the cie.DownloadComplete method's command...
This.Document.Body.contentEditable = .T.  && This is a good context menu
I have tried to wrap that command in TYPE commands attempting to issue it only when "this.document.body" is an object type, but no joy.

On workstations, it appears to occur more frequently... as though its a timing issue with the instantiation of the IE control or the Navigate command.

The original INIT code of PR_HTMLEDIT.CIE looks like...
* Navigate to a blank page

*This.Navigate2("About:Blank")
* Prevent an OLE error, and wait until the object
* gets the blank page open before showing or accessing

LOCAL lnLoadTimeout
lnLoadTimeout = 6       && seconds
WITH This.OBJECT
    .Navigate("about:blank")
    * Wait for load completion
    lnStartSeconds = SECONDS()
    DO WHILE .ReadyState <> 4 ;
            AND (SECONDS()-lnStartSeconds <= lnLoadTimeout )
        DOEVENTS
    ENDDO
ENDWITH
Because i dont see an explicit call to DownloadComplete in the class, I assume that the method is called by the .Navigate method natively.

A template html email file/msg is loaded during the form's INIT using something like the code below, but the reported error does not occur here.
IF FILE("&lcHTMLfile")
    WITH Thisform.Chtmleditor1.oIE
       .Navigate("&lcHTMLFile")
        DO WHILE .ReadyState != 4
            DOEVENTS
         ENDDO
        .Document.Body.contentEditable = .T.
     ENDWITH
ENDIF		
The class's DownloadComplete method which issues the problematic "document.body.contentEditable" command appears to be redundant based on my situation, but i'm wondering if i am moving the problem from one method to another. Plus its hard to produce, but consistant enough to cause headaches.

Any ideas?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform