Delphi Firemonkey TWebbrowser doesn't work on modal dialogs - delphi

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.

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

Related

Why code hint does not appear in Delphi XE3?

I am using Delphi XE3 to develop a FireMonkey application. In the past, there is a code hint function, so that when I complete the name of a form, like this:
MainForm.
When I type the ., the IDE pops up a list of the functions and properties in the MainForm object. However, today I find such a function suddenly disappeared. Therefore, I wonder how to re-enable such a function again.

How to disable vcl styles on external dll forms in delphi

I have an issue in Delphi 10.1 Berlin using VCL Styles and an external DLL.
I'm using a Nitgen DLL to enroll fingerprints in my application. The process is handled by a COM object in NBSPCOM.dll.
When I call the method to enroll, the form from the DLL appears odd. It shows the Form background, images and controls are wrong, etc.
If I compile the application in XE8, the problem vanishes and all works fine.
I can't find the class of the DLL forms to try a VCL Styles hook.
Some screenshots of the form:
Original form
Wrong Form
When you uses the VCL Styles the native winapi controls (Static, Button, RebarWindow32, ...) are styled using a WH_CBT Hook, My guess is which the dll is using a static or Button winapi control where the background of the image is drawn. To overcome this you can disable the styling of these controls using the Vcl.Themes.TStyleManager.SystemHooks property like so
TStyleManager.SystemHooks := [];

Why does DragAcceptFiles not work on the TEdit controls of the Tool Properties dialog in Delphi >=2005?

I am trying to make the TEdit control for the program on the "Tool Properties" dialog in the Delphi IDE (*1) accept dropping files from the explorer. This works fine in Delphi 6 and 7 but no longer works in the "new" IDE of Delphi 2005 up.
In Delphi 6/7 dropping a file on the edit control triggers a WM_DROPFILES message which a hook to the WindowProc of the TEdit can catch. In the later versions, no message is received. The hook on WindowProc still works, as it receives all kinds of other messages.
The dialog layout, names and controls is unchanged as far as I can determine.
As a test I even added my own TEdit and TComboBox to the dialog to make sure it's not a problem of these specific existing controls. They are shown fine, but dropping a file doesn't work with these either.
What else could be the problem?
(*1: the one you get through Tools -> Configure Tools -> Add or Edit
This will be a new functionality in GExperts. Auto complete already works for these controls.)
The code is here:
http://sourceforge.net/p/gexperts/code/HEAD/tree/trunk/Source/IDE/GX_IdeToolPropertiesEnhancer.pas
and the actual hooking code is here:
http://sourceforge.net/p/gexperts/code/HEAD/tree/trunk/Source/Utils/GX_dzVclUtils.pas

Delphi Xe2 VCL style and webbrowser

Win7 x64, Delphi Xe2 update2
Prompt:
The new project, compile as x32, are applied visual (vcl) styles in the project options, by default one is chosen
On the form the button1 and WebBrowser1
In the button we write WebBrowser1.Navigate ('http://google.com');
We start, we press the button - in a browser we see a site google.com, all ок
We compile as x64, it is started ок, by button pressing we receive an error "float division on zerro".
Questions:
At all so (error)? And as with it to struggle? (in x64 mode)
How to apply visual style to strips of scrolling WebBrowser1? (in x32 mode)
:( a native component could not skin, but AlphaControls Skin system - work ok, and webbrowser scrolling lines skinned normal
p.s. update3 yet did not put
p.s.s. bad english: on
This can be done subclassing the TWebBrowser component and handling these events
OnDocumentComplete
OnNavigateComplete2
OnBeforeNavigate2
OnCommandStateChange
OnProgressChange
plus the WM_SIZE windows message.
The key is use the TScrollbar component and a Twincontrol as container to overlap the original webbrowser scrollbars.
I just wrote an article which explains in depth how this can be implemented Delphi Vcl Styles and TWebBrowser
VCL styles cannot be applied to TWebBrowser AFAIK. Its UI is controlled by Internet Explorer, not the VCL.

Pegasus Imaging PrintPro ActiveX control gives error when dropped on Delphi form

I'm trying to use the Pegasus Imaging PrintPro v4 ActiveX control with Delphi 7 on a Win2K box. When I drop the ActiveX control on the form I get the extremely helpful error message
"Access violation at address 00000000. Read of address 00000000."
and the component doesn't appear on the form.
There are a bunch of other Pegasus Imaging ActiveX controls installed and they work fine.
Any suggestions on where to start troubleshooting, I'm not very experienced with ActiveX control (I usually go for native VCL only).
Lachlan
If you download the latest changes file it says that "Fixed an issue where the ActiveX DLL would not register on Windows 2000.".
You should try upgrading to the latest version.
Something in the control is not configured properly. You might not be able to "drop" it on the form, but might have to instantiate it manually. The access violation you are experiencing is the attempt to get the value out of a pointer which is null. Most likely the control has a required construction parameter which is not being set by the Delphi ActiveX component wrapper.

Resources