Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using the web browser control in a form
Message
De
30/10/2001 11:13:30
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Using the web browser control in a form
Divers
Thread ID:
00575116
Message ID:
00575116
Vues:
49
Hi folks,

I have an application where the user will inform me a .html file name to load (he'll choose it in a getfile()), and then I'll have load it and show it in a form, like in a browser. In that form there will be some buttons that he will tell the app what he wants to do. One of these buttons tell the app to save the loaded html file as plain text, in order to parse the text contained in it, for some information.

To do that I must:

1) show a form with the browser control (or automathe IE (?))
2) user presses the "Load" button
3) I show a getfile () dialog
4) user selects the desired file and tell getfile () to open it
5) I load the html file
6) save its contents as text only
7) load (into a string or such) the text only file and parse it
8) save parsed information in an appropriate dbf table

I've found two examples in MSDN files. The first one uses automation, and the second one uses an OLE object.

Question: What example should I choose as the best one to implement what I'm trying?
There is another one, best suited form my case?

Below are the listing of the samples I've found.

Thanks in advance,

Fernando

Example #1
Explorer = CreateObject ("InternetExplorer.Application")
Explorer.Navigate ("http://www.microsoft.com")
Explorer.Visible = .t.
Example #2
PUBLIC oMyHelpViewer

   oMyHelpViewer = NewObject("myhtmlhelpviewer")
   oMyHelpViewer.Show

   DEFINE CLASS myhtmlhelpviewer AS form
      Top = 0
      Left = 0
      Height = 454 
      Width = 633
      DoCreate = .T.
      BorderStyle = 2
      Caption = "Custom HTML Help Viewer"
      MaxButton = .F.
      WindowState = 0
      Name = "Form1"

      ADD OBJECT olecontrol1 AS olecontrol WITH ;
         Top = 10, ;
         Left = 16, ;
         Height = 433, ;
         Width = 601, ;
         Name = "Olecontrol1", ;
         OLEClass = "Shell.Explorer.2"

      PROCEDURE olecontrol1.Refresh
         NODEFAULT
      ENDPROC

      PROCEDURE olecontrol1.Init
         cVFPHelpTopicPath = "mk:@MSITStore:" + "D:\Arquivos de Programas\Microsoft Visual Studio\MSDN\2000JAN\1033\FOXHELP.CHM" + "::/html/vfpstartpage.htm"
         This.Navigate(cVFPHelpTopicPath)
      ENDPROC
   ENDDEFINE 
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform