1

I'm using Delphi XE8, FireMonkey, Win32

I'm trying to load a local HTML file in a TWebBrowser control that is in a modal dialog. I keep getting an OLE error, even when trying to do something as simple as this in a button click:

wbPreview.URL := 'about:blank'; 

Project WI.exe raised exception class EOleException with message 'Unspecified error'.

I'm thinking that the WebBrowser control doesn't work in a form/dialog that is not the main form of the app.

Does anyone have any insight on this? I've tried placing TWebBrowser on the main form, ensured that TWebbrowser in the dialog wasn't in a child control (parent is the form), etc. Nothing works.

4
  • 2
    Delphi XE8, fmx, win32. A secondary form with wb and 2 buttons, shown with Form.ShowModal, 1st. button sets wb.URL to a local .htm file, shows ok. 2nd button sets wb.URL to 'about:blank', clears the viewport. Alternating buttons, changes the wb viewport as expected. No errors, no problems. Commented Oct 5, 2017 at 18:20
  • What happens when you set the second form BorderIcons property to [biSystemMenu,biMaximize] ? (no minimize) Commented Oct 6, 2017 at 11:24
  • Oh, I didn't save the project. What happens for you, what do you expect to happen? What if you don't remove biMinimize. Commented Oct 6, 2017 at 11:27
  • I get the error, so at least now I know how to work around it somewhat. Commented Oct 6, 2017 at 11:31

1 Answer 1

1

The error is not related to whether the form is modal or not, but to whether the form hosting the TWebBrowser has default BorderStyle / BorderIcons.

The problem is reported on Embarcadero Quality Portal with RSP-12640 and a few others.

The issue is corrected in Delphi 10.1 Berlin

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.