Jump to content

Recommended Posts

Posted (edited)

Hey guys,

I have a rather strange problem with the fallowing code:

#include "GUIConstantsEx.au3"
#include "StaticConstants.au3"
#include "ButtonConstants.au3"
#include "IE.au3"

Global $frm_main
Global $lbl_info
Global $btn_cam1
Global $btn_cam2
Global $btn_cam3
Global $btn_cam4
Global $btn_cam5
Global $btn_exit
Global $embedIEreff = _IECreateEmbedded()
Global $embedIEframe

GenerateGUI()
GUILoop()


Func GenerateGUI()

$frm_main = GUICreate("CamControl", 440, 280)
$lbl_info = GUICtrlCreateLabel("Choose:", 0, 0, 190, 30, $SS_CENTER)
$btn_cam1 = GUICtrlCreateButton("1", 20, 35, 150, 35, $BS_CENTER)
$btn_cam2 = GUICtrlCreateButton("2", 20, 75, 150, 35, $BS_CENTER)
$btn_cam3 = GUICtrlCreateButton("3", 20, 115, 150, 35, $BS_CENTER)
$btn_cam4 = GUICtrlCreateButton("4", 20, 155, 150, 35, $BS_CENTER)
$btn_cam5 = GUICtrlCreateButton("5", 20, 195, 150, 35, $BS_CENTER)
$btn_exit = GUICtrlCreateButton("Exit", 45, 245, 100, 25)
$embedIEframe = GUICtrlCreateObj($embedIEreff, 190, 10, 240, 260)
;$embedIEframe = GUICtrlCreateObj($embedIEreff, 190, 10, 1, 1)
GUICtrlSetFont($lbl_info, 14, 400, 0, "MS Reference Sans Serif")
GUISetState(@SW_SHOW, $frm_main)

EndFunc   ;==>GenerateGUI


Func GUILoop()

Local $msg
Local $JoyBtn
While 1 = 1
  $msg = GUIGetMsg()
  Select
   Case $msg = $GUI_EVENT_CLOSE
    Exit
   Case $msg = $btn_cam1
    _IENavigate($embedIEreff, "192.168.1.107")
   Case $msg = $btn_cam2
    _IENavigate($embedIEreff, "www.google.com")
   Case $msg = $btn_exit
    Exit
  EndSelect
WEnd

EndFunc   ;==>GUILoop

Now the strange thing:

This all worked fine this morning. Without touching the code, the IP address now doesnt work, but google still does.

This program cannot display the webpage


[b] Most likely causes:[/b]
[list]
[*]You are not connected to the Internet.
[*]The website is encountering problems.
[*]There might be a typing error in the address.
[/list]

If I open the IP address in a normal IE window it works. Im really lost here. Using http://192.168.1.107/ in the code doesnt help. As mentioned, this all worked fine just this morning so I think that there is something wrong with the Embedded IE window.

Can someone help?

Thanks!

Edited by tomaskir
Posted

change GuiLoop function

Func GUILoop()
Local $msg
Local $JoyBtn
While 1 = 1
  $msg = GUIGetMsg()
  Select
   Case $msg = $GUI_EVENT_CLOSE
    Exit
   Case $msg = $btn_cam1
    _IENavigate($embedIEreff, "http://192.168.0.75")
   Case $msg = $btn_cam2
    _IENavigate($embedIEreff, "www.google.com")
   Case $msg = $btn_exit
    Exit
  EndSelect
WEnd
EndFunc   ;==>GUILoop

and try http:// +ip+

like this :

_IENavigate($embedIEreff, "http://192.168.0.75")

Posted (edited)

change GuiLoop function

Func GUILoop()
Local $msg
Local $JoyBtn
While 1 = 1
  $msg = GUIGetMsg()
  Select
   Case $msg = $GUI_EVENT_CLOSE
    Exit
   Case $msg = $btn_cam1
    _IENavigate($embedIEreff, "http://192.168.0.75")
   Case $msg = $btn_cam2
    _IENavigate($embedIEreff, "www.google.com")
   Case $msg = $btn_exit
    Exit
  EndSelect
WEnd
EndFunc   ;==>GUILoop

and try http:// +ip+

like this :

_IENavigate($embedIEreff, "http://192.168.0.75")

Didnt help, still getting "This program cannot display the webpage" in the embedded window.

In normal IE the webpage works however.

Edited by tomaskir
Posted

Not likely related to AutoIt. Suggest google'ing "This program cannot display the webpage" and you'll find lots of discussion.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...