WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

MSHTML

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Blank Frames with MSHTML in Dialogs


Question:

I'm trying to display some HTML inside a pair of FRAMES/FRAMESET, but no matter what I do, it won't show in the dialog. I've tried hardcoding and DHTML. You can set a document's .url property to a file name like:
document.url = "frameMain.html"
but that shows blank as well. The dynamic HTML spots the two frames, just nothing in them. I'm pretty new to Winbatch Dialogs so I hope it's not something I've overlooked.
#DefineFunction   ExamProc(MyDialogHandle,MyDialogMessage,MyDialogControlID,param4,param5)
; Dialog messages.
   MSG_INIT         = 0     ; The one-time initialization.
   MSG_GETEVENT     = 1
   MSG_BUTTONPUSHED = 2     ; Button press.
   MSG_GETOBJECT    = 3
   MSG_COMEVENT     = 14    ; COM control event fired.
;
   Switch MyDialogMessage
     Case MSG_INIT
         ; enable 1 second timer events
         DialogProcOptions(MyDialogHandle, 1, 1000)
         ;
         ; Get the control's object
         document = DialogObject(MyDialogHandle, 001, MSG_GETOBJECT)
         document.writeln(`<FRAMESET COLS="50%%,50%%">`)
         document.writeln(`<FRAME id="LeftFrame"  src="fr1.html" noresize="noresize">`)
         document.writeln(`<FRAME id="RightFrame" src="fr2.html">`)
         document.writeln(`</FRAMESET>`)
         document.close()

         ; Add an event
         DialogObject(MyDialogHandle, 001, MSG_GETEVENT,  "onclick", 1)
         Break
    Case MSG_COMEVENT
       ; Correct COM control and event?
;       message("Debug", MyDialogControlID)
       Break
    Case MSG_BUTTONPUSHED
;        message("Debug", "Button Pushed")
       ; Release Objects.
       Dlg_EventInfo = 0
       objVoice   = 0
       objCal     = 0
       Break
   EndSwitch ; MyDialogMessage
;
   Return(-1) ; Do default processing
#EndFunction

ExamFormat=`WWWDLGED,6.1`
ExamCaption=`Full Screen Browser Example`
ExamX=0
ExamY=0
ExamWidth=512
ExamHeight=364
ExamNumControls=002
ExamProcedure=`ExamProc`
ExamFont=`DEFAULT`
ExamTextColor=`DEFAULT`
ExamBackground=`DEFAULT,0|0|64`
ExamConfig=0
Exam001=`005,005,496,330,COMCONTROL,DEFAULT,"mshtml:",DEFAULT,1,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
Exam002=`231,337,060,012,PUSHBUTTON,DEFAULT,"OK",1,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT`

ButtonPushed=Dialog("Exam")
Exit

Answer:

Looks like you may need to specify the full path for the Frames. And you must apparently call the Reload method. See lines marked by ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#DefineFunction   ExamProc(MyDialogHandle,MyDialogMessage,MyDialogControlID,param4,param5)
; Dialog messages.
   MSG_INIT         = 0     ; The one-time initialization.
   MSG_GETEVENT     = 1
   MSG_BUTTONPUSHED = 2     ; Button press.
   MSG_GETOBJECT    = 3
   MSG_COMEVENT     = 14    ; COM control event fired.
;
   Switch MyDialogMessage
     Case MSG_INIT
         ; enable 1 second timer events
         DialogProcOptions(MyDialogHandle, 1, 1000)
         ;
         ; Get the control's object
         document = DialogObject(MyDialogHandle, 001, MSG_GETOBJECT)
         document.writeln(`<FRAMESET COLS="50%%,50%%">`)
         document.writeln(`<FRAME id="LeftFrame"  src="C:\Temp\fr1.html" noresize="noresize">`);!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
         document.writeln(`<FRAME id="RightFrame" src="C:\Temp\fr2.html">`) ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
         document.writeln(`</FRAMESET>`)
         document.close()

         ; This is needed to force frame loading. Don't know why this is needed either.
         document.parentwindow.location.Reload  ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


         ; Add an event
         DialogObject(MyDialogHandle, 001, MSG_GETEVENT,  "onclick", 1)
         Break
    Case MSG_COMEVENT
       ; Correct COM control and event?
;       message("Debug", MyDialogControlID)
       Break
    Case MSG_BUTTONPUSHED
;        message("Debug", "Button Pushed")
       ; Release Objects.
       Dlg_EventInfo = 0
       objVoice   = 0
       objCal     = 0
       Break
   EndSwitch ; MyDialogMessage
;
   Return(-1) ; Do default processing
#EndFunction

ExamFormat=`WWWDLGED,6.1`
ExamCaption=`Full Screen Browser Example`
ExamX=0
ExamY=0
ExamWidth=512
ExamHeight=364
ExamNumControls=002
ExamProcedure=`ExamProc`
ExamFont=`DEFAULT`
ExamTextColor=`DEFAULT`
ExamBackground=`DEFAULT,0|0|64`
ExamConfig=0
Exam001=`005,005,496,330,COMCONTROL,DEFAULT,"mshtml:",DEFAULT,1,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
Exam002=`231,337,060,012,PUSHBUTTON,DEFAULT,"OK",1,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
ButtonPushed=Dialog("Exam")
Exit

Article ID:   W16935
File Created: 2007:07:03:14:27:06
Last Updated: 2007:07:03:14:27:06