problem with ActiveX navigate

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
fouednoomen
Posts: 188
Joined: Sun Oct 14, 2012 8:33 am
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL, Oracle, ODBC
Location: Tunisia

problem with ActiveX navigate

Post by fouednoomen »

Hi all Friands.

I have this message when open url on my hmg application
Attachments
vavigate error.jpg
vavigate error.jpg (158.34 KiB) Viewed 8454 times
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: problem with ActiveX navigate

Post by edk »

Hmm, I installed the "Crystal ball of seer" app on my phone, looked through it at your screenshot, and damn, the ball didn't show me the source code, I think this app is broken .... :roll: :roll: :roll:

So I took tarot cards, unfolded the deck and guessing there might be a solution: https://weblog.west-wind.com/posts/2011 ... ie-version
User avatar
fouednoomen
Posts: 188
Joined: Sun Oct 14, 2012 8:33 am
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL, Oracle, ODBC
Location: Tunisia

Re: problem with ActiveX navigate

Post by fouednoomen »

Procedure Http()
cAddress := Alltrim(ARTICLE->LIEN_HTTP)
If len(Alltrim(ARTICLE->LIEN_HTTP)) >0
DEFINE WINDOW Win_http ;
AT 95,0 ;
WIDTH 1024 ;
HEIGHT 620 ;
ICON 'Solex.ICO' ;
MODAL

@ 0,0 ACTIVEX Test ;
WIDTH 1000 ;
HEIGHT 580 ;
PROGID "shell.explorer.2"

Win_http.Test.Object:Navigate(cAddress)

END WINDOW
ACTIVATE WINDOW Win_http
endif
Return
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: problem with ActiveX navigate

Post by edk »

Be so kind and tell us what the value of the ARTICLE-> LIEN_HTTP field is, which is bothering you.
User avatar
fouednoomen
Posts: 188
Joined: Sun Oct 14, 2012 8:33 am
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL, Oracle, ODBC
Location: Tunisia

Re: problem with ActiveX navigate

Post by fouednoomen »

Hi Edk

Find below the value of the ARTICLE-> LIEN_HTTP field

https://www.piecesauto.com/fr/recherche ... 1878085741

Best regards
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: problem with ActiveX navigate

Post by AUGE_OHR »

hi,
fouednoomen wrote: Wed Nov 10, 2021 8:11 am Find below the value of the ARTICLE-> LIEN_HTTP field
https://www.piecesauto.com/fr/recherche ... 1878085741
when i disable Java-Script i can not access Website of your Link.

but "shell.explorer.2" , using old IE -Engine, does not work with Java-Script so you get Error Message
i´m not a Internet Guru but i think other User can tell you how to "Download" Website ( CURL ? )
have fun
Jimmy
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: problem with ActiveX navigate

Post by edk »

So my tarot cards were right. :D
The page you are trying to display is not entirely compatible with IE.
"Shell.Explorer.2" creates a IE 7.0 embedded browser by default.
You should change the emulation to IE11. However, despite this, the page will not be displayed completely properly. You can check this by launching IE Browser on your computer and entering the address of the problematic website, then do the same in Edge Browser - you will see the differences.
Below code to change IE emulation and disabling error messages:

PS. I am still wondering, while browsing your code, would it be better to open link in the default browser instead of browsing the it in the modal window?
Or https://hmgforum.com/viewtopic.php?p=67093#p67093 :?:

Code: Select all

#include "hmg.ch"

Function Main()

Local cExeName := hb_FNameNameExt(hb_ProgName())
Local cRegPath := "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\" + cExeName

//check registry
IF RegistryRead( cRegPath ) = NIL
	/* Browser Emulation
	   Windows Internet Explorer 8 and later. The FEATURE_BROWSER_EMULATION feature defines the default 
	   emulation mode for Internet Explorer and supports the following values.
	   Value 	Description
	   11001 	Internet Explorer 11. Webpages are displayed in IE11 edge mode. */

	   RegistryWrite( cRegPath, 11001 )
ENDIF

DEFINE WINDOW Win_1 AT 0 ,0  WIDTH GetDesktopRealWidth() HEIGHT GetDesktopRealHeight() TITLE "IE 11 Compatible mode" MAIN

	@ 20,20 TEXTBOX t_url ;
		WIDTH 500 ;
		VALUE "https://www.piecesauto.com/fr/recherche/1.html?reference=1878085741" ;
		
	@ 20, 550 BUTTON Button_1 ;
		CAPTION "Go ActiveX" ;
		ACTION Win_1.Activex_1.Object:Navigate ( AllTrim( Win_1.t_Url.Value ) ) ;
		WIDTH  150 HEIGHT 25

		
	@ 20, 720 BUTTON Button_2 ;
		CAPTION "Open in Browser" ;
		ACTION ShellExecute ( NIL, "Open", AllTrim( Win_1.t_Url.Value ) , NIL, NIL, SW_SHOWNORMAL );
		WIDTH  150 HEIGHT 25

	DEFINE ACTIVEX Activex_1
        ROW    50
        COL    20
        WIDTH  Win_1.Width - 50
        HEIGHT Win_1.Height - 100
        PROGID "shell.explorer.2"
    END ACTIVEX
    Win_1.Activex_1.Object:Silent := 1

END WINDOW

ACTIVATE WINDOW Win_1

Return Nil                         
User avatar
fouednoomen
Posts: 188
Joined: Sun Oct 14, 2012 8:33 am
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL, Oracle, ODBC
Location: Tunisia

Re: problem with ActiveX navigate

Post by fouednoomen »

Many thanks Edk

it's run perfectly

regards
foued
User avatar
Claudio Ricardo
Posts: 367
Joined: Tue Oct 27, 2020 3:38 am
DBs Used: DBF, MySQL, MariaDB
Location: Bs. As. - Argentina

Re: problem with ActiveX navigate

Post by Claudio Ricardo »

Para solventar el inconveniente del obsoleto IE, el Dr. Claudio Soto compartió aqui hace un par de
meses una solución que aprovecha el motor de Edge... es facil de implementar y funciona perfecto.

To solve the problem of the obsolete IE, Dr. Claudio Soto shared here a couple of months ago a
solution that takes advantage of the Edge engine ... is easy to implement and works perfect.

hmg_webview2_version03 = https://www.hmgforum.com/viewtopic.php? ... e&start=20
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
Post Reply