mer. 23 décembre 2020, 10h39
Hamidou
Maroc
atoutfox.public.association
Re: Affichage localisation via google map
voila la correction de ta procédures VFP
--------------------------------------------------------
* Localisation
LCurl = "
https://maps.google.com/maps?q=122-route-des-Puthods,01340,CRAS-SUR-REYSSOUZE,FRANCE";
ShowMap(m.LCurl)
*****
Procedure ShowMap(tcUrl)
Public oForm
oForm = Createobject('form1')
oForm.Show()
Declare ShellExecute In shell32.Dll Integer, String, String, String, String, Integer
* Laisser windows de decider, quelle browser il va appler (le browser par defaukt)
ShellExecute( 0 , [open] , LCurl , [] , [] , 1 )
* undeclare API-function
Clear Dlls [ShellExecute]
* release form
oForm.RELEASE()
Endproc
*****FIN
Function GetHTML
Local myVar
TEXT to myVar noshow
ENDTEXT
Return myVar
Endfunc
Define Class HTMLViewer As OleControl
OleClass = 'Shell.Explorer'
Procedure Refresh
Nodefault
Endproc
Procedure LoadHTML(tcHTML)
With This
.Navigate2("about:blank")
.Document.Write(m.tcHTML)
Endwith
Enddefine
Define Class form1 As Form
Height = 600
Width = 800
Caption = "HTML sample"
Add Object HTMLViewer As HTMLViewer With ;
Top = 10, ;
Left = 10, ;
Height = 580, ;
Width = 780, ;
Anchor = 15,;
Visible = .T., ;
Name = "HTMLViewer"
Procedure Init
Lparameters tcHTML
If !Empty(m.tcHTML)
With Thisform.HTMLViewer
.LoadHTML(m.tcHTML)
Endwith
Endif
Endproc
Procedure HTMLViewer.NavigateError
Lparameters pdisp, url, frame, statuscode, Cancel
Set Step On
Cancel = .T.
Endproc
Procedure HTMLViewer.BeforeNavigate2
Lparameters pdisp, url, Flags, targetframename, postdata, headers, Cancel
Cancel = .T. && prevents actual navigation
Endproc
Procedure HTMLViewer.Refresh
Nodefault
Endproc
Enddefine
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000019768