Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to stuff HTML into a browser control
Message
 
 
À
22/09/2001 12:20:26
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00559092
Message ID:
00559769
Vues:
19
Hi!

Well, I remember there was the same problem in my application where I required to track all temporary document files opened in Word for read-only viewing by user. Because user might want to see many documents at once, I cashed them in temporary files, as well as allowed user to see them for entire session of application work. However, after application shutdown, I try to delete all files and then show warning to user if some files are still opened in thw Word about some files could be left on disk in temporary files folder. (Well, this could be changed to use closing of all Word instances, but this was not quite a good idea.) In your case it is even more simple because you're sure that after closing the form with WEB Browser Control temporary files could be deleted at all.

The approach is simple - make a public object in the application that will track all temporary filenames of files created in the application and that you cannot delete immediately. In that object use method like "RegisterTempFile" to register temporary file in this object's array. Then in the Destroy event of that object delete all temporary files if they're not already deleted and if it is possible to delete.

Just a housekeeping...

>I did that in the first try, had a thisform.obrowser.navigate("about:blank"), same result. The value in the .inner html had just the opening and closing html and body tags, plus the cr/lf pair between. So it was initialised.
>
>The help I get on rightclick on the bare browser control takes me to FFC wrapper control help, which actually has just a list of properties without much of explanation.
>
>The trouble with using the temp files is that you can't delete them right away, because the browser control keeps them open for a while, so it involves some housekeeping.
>
>>Try to load from disk some sort of empty HTML file with empty Body, hen assign the body through objects interface. You still need a file, but only one that is fixed.
>>
>>>>Hi!
>>>>
>>>>Try to use something like ...Document.All(0).InnerHTML = "HTML here". I guess Document object in the WEB Browser control is the same reference as a Document object for a JavaScript. In IE5.0 and higher you can change the layout of page by assigning the tags to innerHTML property of several container objects on HTML page, include BODY. I do not know exactly, however, how to access the BODY element from the Document object.
>>>
>>>Worked, sort of. The property gets assigned, but nothing shows up. It probably takes setting several other properties and getting the object into a state when it would accept this. At times it complained of the .document property being totally absent - I'm getting this all the time with automation objects, you can never be sure if all of its objects or collections will exist. It could return .null. at least, but no, it has to raise an error.
>>>
>>>I've stuffed the _browser object from FFC for the time being, and seems to be dumping the memo into a html file is the only way, at least until search server on UT is back in business.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform