

- Powerbuilder ole control microsoft web browser how to#
- Powerbuilder ole control microsoft web browser Pc#
MessageBox( "OLE_1 External Exception Handler", description) If the OLE control also has an "OCXError" then I implement that event too.Ī typical handler would be like this for the "ExternalException" event: ?user attempting to navigate or further than pages existīecause of this, I always implement the "ExternalException" and "Error" events. Like many other OLE controls, the web browser control returns an OLE exception whenever just about anything fails. store the new height/width in the window's instance variables Ole_1.object.height = UnitsToPixels( objheight, YUnitsToPixels!) Ole_1.object.width = UnitsToPixels( objWidth, XUnitsToPixels!) Tell the control - but first convert to PIXELS ObjHeight = newHeight - (marginTop + marginBottom) ObjWidth = newWidth - (marginRight + marginLeft) MarginBottom = iOldWinHeight - ole_1.height - marginTop MarginRight = iOldWinWidth - ole_1.width - marginLeft This technique depends on there being NO BORDER around the OLE control The space (margins) around the web-browser control The real work is in the window's "Resize" event:Įvent window.Resize(unsignedlong sizeType, integer newWidth, integer newHeight ) This example assumes there is no border property around the web browser control.įirst - a couple of window level instance variables:Īnd initialize the values in the window's "Open" event: Using a suggestion I saw in the news-groups which I expanded on. Provides early warning about a navigation action. ?BeforeNavigate2( many args ) - doesn't work in PowerBuilder 6.x Use for a progress indicator during any object downloading.

?ProgressChange( long progress, long progressMax ) ?DocumentComplete( oleobject obj, any URL ) - doesn't work in PowerBuilder 6.xįired when the entire document has finished. Provide user feedback about any intermediary downloads. Unfortunately, I haven't been able to get the "print preview" command to work. Ole_1.object.ExecWB( OLECMDID_PAGESETUP, OLECMDEXECOPT_DONTPROMPTUSER, AsStatement! ) Similar to printing, the page setup is a simple command, but it requires the "AsStatement!" modifier. Ole_1.object.ExecWB( OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, AsStatement! ) Ole_1.object.ExecWB( OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER ) Printing is a bit more complex with more options. This can either be a separate button, or an processor in a single-line-edit like:īackward and Forward in the Web Page history:Įvery web browser needs a "Back" and "Forward" button to navigate the browser's history. My sample is using the web browser control that ships with Microsoft's Internet Explorer 4.0 SP1a. The window "ReSize" event also resizes the web browser control to keep a constant relative size. The other buttons are for special features of the control. The single edit field, "sle_1" is for entering new URLs and call the web browser control when is pressed. This listbox is just a way to see the activity. All the events on this OLE control add a line of information to the listbox "lb_1". The sample application consists of the "Microsoft Web Browser Control" as object "ole_1". Microsoft Web Browser Control, ActiveX, PowerBuilder, Resize, BeforeNavigate2, NavigateComplete, DocumentComplete

This has been corrected in PowerBuilder 7.x The variable names and numerous other techniques are undoubtedly non-standard but you must remember that I am typically a C++ programmer, not a PowerBuilder programmer.īecause of a bug in PowerBuilder 6.x events including BeforeNavigate2, NavigateComplete, DocumentComplete will never fire.
Powerbuilder ole control microsoft web browser how to#
This document describes how to use the "Microsoft Web Browser" ActiveX control which ships with Internet Explorer. Occasionally it is handy for a PowerBuilder application to have a web browser embedded in it.
Powerbuilder ole control microsoft web browser Pc#
Platform: PC Operating System: Windows 95, Windows NT SUMMARY: Occasionally it is handy for a PowerBuilder application to have a web browser embedded in it.
