From: hpeter on 1 Sep 2007 23:25 I am able to create COM client objects (any MS office) and call some methods but not with microsoft webbrowser control. I am able to create the webbrowser object but the method navigate() generates an exception error Can anyone confirm this simple test IF SUCCEEDED( hResult := VOCOMCreateObject( "Shell.Explorer", @oIE ) ) oIE:Navigate( "about:blank") // Exception error: 100 // Idispatch_:invokehelper line 110 ELSE VOCOMGenComError( hResult ) ENDIF
From: Geoff Schaller on 1 Sep 2007 23:57 You could do this without VOCOM. VOCOM doesn't give you any particular advantage to do something so simple with regular VO. "hpeter" <hpatino(a)rocketmail.com> wrote in message news:1188703549.178056.153400(a)k79g2000hse.googlegroups.com: > I am able to create COM client objects (any MS office) and call some > methods but not with microsoft webbrowser control. > > I am able to create the webbrowser object but the method navigate() > generates an exception error > > Can anyone confirm this simple test > > IF SUCCEEDED( hResult := VOCOMCreateObject( "Shell.Explorer", > @oIE ) ) > > oIE:Navigate( "about:blank") > > // Exception error: 100 > // Idispatch_:invokehelper line 110 > > > > ELSE > > VOCOMGenComError( hResult ) > > ENDIF
From: hpeter on 2 Sep 2007 11:49 > You could do this without VOCOM. VOCOM doesn't give you any particular > advantage Geoff It depends. I am interested in playing with "print templates" and for that I do require more than the regular VO webbrowser since I need to obtain an IOleCommandTarget interface by calling QueryInterface on the IHTMLDocument2 interface using IID_IOleCommandTarget. And the Queryinterface is not implemented in VO but in . http://msdn2.microsoft.com/en-us/library/Bb250434.aspx By the way through COM or COMSDK the way to instantiate the COM object is using "internet.application" instead of "shell.explorer"
From: Geoff Schaller on 2 Sep 2007 17:47 Fair enough. ....but I suspect most folks can't help once you get into VOCOM. Have you contacted Rod? "hpeter" <hpatino(a)rocketmail.com> wrote in message news:1188748143.430602.60920(a)w3g2000hsg.googlegroups.com: > > You could do this without VOCOM. VOCOM doesn't give you any particular > > advantage > > > Geoff > > It depends. I am interested in playing with "print templates" and for > that I do require more than the regular VO webbrowser since I need to > obtain an IOleCommandTarget interface by calling QueryInterface on > the IHTMLDocument2 interface using IID_IOleCommandTarget. And the > Queryinterface is not implemented in VO but in . > > http://msdn2.microsoft.com/en-us/library/Bb250434.aspx > > By the way through COM or COMSDK the way to instantiate the COM object > is using "internet.application" instead of "shell.explorer"
From: Willie Moore on 2 Sep 2007 20:07
Hey, VOCOM does throw an error. Here is how it is done with plain VO. Yo will notice that I am instanciating an OLEControl, not an oleAutoObject. Regards, Willie METHOD Start() CLASS App LOCAL oMainWindow AS ShellWindow LOCAL oWebBrowser AS webbrowserloose oMainWindow := ShellWindow{SELF} oMainWindow:caption := "Image Viewer" oMainWindow:Show(SHOWCENTERED) oWebBrowser := webbrowserloose{oMainWindow} oWebBrowser:show() oWebBrowser:HtmlPage("http:\\wcmdell\test\mapquest.htm") SELF:Exec() METHOD Init( oWindow) CLASS WebBrowserLoose SUPER:Init( oWindow, TRUE, TRUE ) // SELF:Menu := WebBrowserMenu{ SELF } SELF:Layout := Dimension{ 1,1 } // Easist to use split windows as they adjust the control size SELF:Caption := "WebBrowser Loose" SELF:MSWebBrowser := OLEControl{ SELF, -1, Point{}, Dimension{} } SELF:MSWebBrowser:HyperLabel := HyperLabel{#MSWebBrowser,NULL_STRING,NULL_STRING,NULL_STRING} SELF:ValidBrowser := SELF:MSWebBrowser:CreateEmbedding( "Shell.Explorer" ) IF SELF:ValidBrowser // Let MS win the Browser wars so this should never occur <g> // It's hard to find a machine with IE3/4 so I dont know what will happen! SELF:SetPaneClient( SELF:MSWebBrowser, 1 ) SELF:MSWebBrowser:Show() // SELF:HtmlPage("c:\test\index.htm" ) // Slack, but simple. Dont forget drag and drop works ELSE WarningBox{ SELF, "HTML File Browser", "IE3 or IE4 Not Installed, unable to view HTML page" }:Show() ENDIF METHOD HtmlPage( cFile ) CLASS WebBrowserLoose // SELF:MSWebBrowser:Navigate( "file://" + cFile ) SELF:MSWebBrowser:Navigate( cFile ) CLASS WebBrowserLoose INHERIT SplitWindow EXPORT MSWebBrowser AS OBJECT // If this was OLEControl, there would compile errors on the methods EXPORT ValidBrowser AS LOGIC METHOD GoBack() CLASS WebBrowserLoose LOCAL bError AS CODEBLOCK bError:=ErrorBlock({ |x| WebBrowserLooseTrapError(x) }) // Lazy way to avoid errors // Would be nice if someone could work out have to dim buttons when appropropriate. BEGIN SEQUENCE SELF:MSWebBrowser:GoBack() ErrorBlock( bError ) RECOVER ErrorBlock( bError ) END SEQUENCE METHOD GoForward() CLASS WebBrowserLoose LOCAL bError AS CODEBLOCK bError:=ErrorBlock({ |x| WebBrowserLooseTrapError(x) }) // Lazy way to avoid errors BEGIN SEQUENCE SELF:MSWebBrowser:GoForward() ErrorBlock(bError) RECOVER ErrorBlock( bError ) END SEQUENCE METHOD Destroy() CLASS WebBrowserLoose IF .NOT. InCollect() IF SELF:ValidBrowser // Important to Call browser's destroy method manually SELF:MSWebBrowser:Destroy() ENDIF ENDIF SUPER:Destroy() RETURN NIL METHOD FileClose() CLASS WebBrowserLoose SELF:EndWindow() STATIC FUNCTION WebBrowserLooseTrapError(oError AS Error) BREAK oError RETURN NIL "hpeter" <hpatino(a)rocketmail.com> wrote in message news:1188703549.178056.153400(a)k79g2000hse.googlegroups.com... >I am able to create COM client objects (any MS office) and call some > methods but not with microsoft webbrowser control. > > I am able to create the webbrowser object but the method navigate() > generates an exception error > > Can anyone confirm this simple test > > IF SUCCEEDED( hResult := VOCOMCreateObject( "Shell.Explorer", > @oIE ) ) > > oIE:Navigate( "about:blank") > > // Exception error: 100 > // Idispatch_:invokehelper line 110 > > > > ELSE > > VOCOMGenComError( hResult ) > > ENDIF > |