Jump to content

Recommended Posts

Posted

I am trying to embedd local html file into my application. Its not working for me?

Any idea.

Regards:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <file.au3>

_IEErrorHandlerRegister ()
Dim $aRecords

GUICreate("Embedded Web control Test", 640, 580, _
        (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
        $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)

If Not _FileReadToArray(@ScriptDir & "\workspace\" & "Export.html",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array error:" & @error)
   Exit
EndIf
Local $HTML ="" 
For $x = 1 to $aRecords[0]
    $HTML = $HTML & $aRecords[$x] & @CRLF
Next

consolewrite($HTML & @CRLF)
     
$oIE = _IECreateEmbedded ()

$GUIActiveX = GUICtrlCreateObj($oIE, 10, 20, 600, 360)
_IEDocWriteHTML($oIE,$HTML)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

GUIDelete()

Exit

Be Green Now or Never (BGNN)!

Posted (edited)

Why you don't use directly _IENavigate()instead read in array and then write html?

I neeed to read from local file system, not from web server.

_IENavigate require URL

Thanks, Its working now with _IENavigate.

I realy dont know what happened before. probably I had invalid characters in the html file

Edited by lsakizada

Be Green Now or Never (BGNN)!

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...