Board index » delphi » HELP: Accessing The Events Of An OLE Automation Object

HELP: Accessing The Events Of An OLE Automation Object

Does anyone know how to access the standard documented events of an OLE
automation object through Delphi 2.0 ...

I am currently building an application that launches and controls Microsoft
Internet Explorer 3.0 as an OLE automation object. The object definition can
be found in the Microsoft ActiveX Software Developers kit and includes
Properties, Methods and Events.

Delphi 2.0 makes it easy to access the properties and events of the object
and it is suprising what you can do by accessing these alone. However I would
like to be able to access it's events also. Does anyone know how this can be
done, or even the general direction to proceed in.

Thanks

Dom Williams

EXAMPLES AND DOCUMENTATION

(1) InternetExplorer Object:
----------------------------

PROPERTIES: Application, Busy, Container, Document, Filename, FullName,
FullScreen, Height, Left, Name, Parent, Path, StatusBar, StatusText, ToolBar,
Top, TopLevelContainer, Type, Visible, Width

METHODS: GoBack, GoForward, GoHome, GoSearch, Navigate, Quit, Refresh, Stop

EVENTS: OnBeginNavigate, OnCommandStateChange, OnDownloadBegin,
OnDownloadComplete, OnNavigate, OnNewWindow, OnProgress, OnQuit,
OnStatusTextChange

(2) Sample Code:
----------------

    // Create a copy of Internet Explorer if we don't already have one.
    if VarIsEmpty(IE) then
      IE := CreateOLEObject('InternetExplorer.Application.1');

    // Set object properties.
    IE.StatusBar := True;
    IE.FullScreen := False;
    IE.Width := 600;
    IE.Height := 400;
    IE.Visible := True;
    IE.StatusText := 'I am controlling this Internet Explorer';

    // Call navigate method.
    if Length(LastURL) <> 0 then IE.Navigate(LastURL)
    else IE.Navigate(DefaultURL);

-- ////////////////////////////////////////////////////////////////////
Dom Williams                    Phone: +44 (171) 286 0552
{*word*137} Consultant            Fax:   +44 (171) 289 4826
and Technical Director          Email: d...@connected-place.co.uk
Connected Place Ltd             URL: http://connected-place.co.uk
////////////////////////////////////////////////////////////////////

 

Re:HELP: Accessing The Events Of An OLE Automation Object


Quote
> Dom Williams <d...@connected-place.co.uk> wrote in article

<31EBD737.7...@connected-place.co.uk>...

Quote
> Does anyone know how to access the standard documented events of an OLE
> automation object through Delphi 2.0 ...

> I am currently building an application that launches and controls
Microsoft
> Internet Explorer 3.0 as an OLE automation object. The object definition
can
> be found in the Microsoft ActiveX Software Developers kit and includes
> Properties, Methods and Events.

> [example deleted]

OLE Automation objects don't fire events unless they are OLE/ActiveX
Controls. The IE3 Beta includes a complete Internet Explorer as an ActiveX
Control (sorry I don't remember the filename). In order to use this
control in Delphi, you should select Component | Install from the menu and
then click the OCX button. You can then select the Internet Explorer
Control (or browse for it on disk if necessary by clicking the Register
button). After clicking OK in both dialogs, the Visual Component Library
will be rebuilt and a component for the IE3 control will appear on the OCX
tab of the comonent palette. You can then place this component on a form
and use its properties, methods AND EVENTS just like you would any other
Delphi component.

Quote

> ////////////////////////////////////////////////////////////////////
> Dom Williams                       Phone: +44 (171) 286 0552
> {*word*137} Consultant               Fax:   +44 (171) 289 4826
> and Technical Director             Email: d...@connected-place.co.uk
> Connected Place Ltd                URL: http://connected-place.co.uk
> ////////////////////////////////////////////////////////////////////

--
Kenny Pitt
NCR Retail Systems Group - Atlanta, GA
Kenny.P...@AtlantaGA.NCR.COM

Other Threads