Topic: Twebbrowser Control

Dear Dimitri
I know to be able to display PDF files you need to add a web browser control to your form
As the MVD is written using Delphi
Is it possible to add Twebbrowser control
Your kind effort is highly appreciated
Regards

Re: Twebbrowser Control

Hello,


Yes, I added TWebBrowser to MVD, please download this version:
https://www.dropbox.com/s/ul1rf42j31big … a.zip?dl=0


in the beta version you can create TWebBrowser only using the script, example:

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
var
    Web: TWebBrowser;
begin
    Web := TWebBrowser.Create(Form1);
    TWinControl(Web).Parent := Form1;
    Web.Width := Form1.Width;
    Web.Height := Form1.Height;

    Web.Navigate('c:\document.pdf');
end;
Dmitry.

3 (edited by SWGAK 2016-06-07 03:41:08)

Re: Twebbrowser Control

Hello Dmitry

How do you force a TWebBrowser refresh?

I can't seem to get the TWebBrowser.refresh and TWebBrowser.Refresh2 (overloaded) methods to work since FastScript doesn't support the type OleVariant.

Could you please post some example code for this?

Thank you

MAK

Re: Twebbrowser Control

SWGAK wrote:

Hello Dmitry

How do you force a TWebBrowser refresh?

I can't seem to get the TWebBrowser.refresh and TWebBrowser.Refresh2 (overloaded) methods to work since FastScript doesn't support the type OleVariant.

Could you please post some example code for this?

Thank you

MAK

Hello,


Please download latest beta version 2.6
https://www.dropbox.com/s/pebrvqwqcbluy … a.zip?dl=0


I have added methods Refresh and Refresh2

Dmitry.

5 (edited by SWGAK 2016-06-07 19:52:28)

Re: Twebbrowser Control

Thank you for the quick fix, unfortunately, I am not able to use the new BETA 2.6 because the compiled project crashes when I try to run it with an error message:


Application Error:
Exception EAccessViolation in module Project-Manage.exe at 0051C530.
Access violation at address 0031C530 in module 'Project-Manage.exe'.
Read of address 00000000.

This crash happens with version 2.5 too as I have reported earlier, but the crash does not occur if it's compiled using MVD version 2.4.



MAK

Re: Twebbrowser Control

SWGAK
I think you have some script in the bottom section between begin end. which use SQL queries, just move this script to event OnShow of main form.


In ver 2.5 and later don't allows using sql queries in the begin end. section.

Dmitry.

Re: Twebbrowser Control

Hello Dmitry

No, I am connecting to the database manually here, but I don't have any queries there.

MAK

Re: Twebbrowser Control

Yay!!!

I moved all of the database connection code to the main form and the error no longer happens.

Thank you Dmitry!!!

MAK

9 (edited by SWGAK 2016-06-07 23:30:10)

Re: Twebbrowser Control

How do you call the web.refresh method?

I have tried web.refresh and TControl(Web).Refresh but neither is working.

(My TWebBrowser is named "Web".)

MAK

Re: Twebbrowser Control

SWGAK wrote:

How do you call the web.refresh method?

I have tried web.refresh and TControl(Web).Refresh but neither is working.

(My TWebBrowser is named "Web".)

MAK

Checked, it works.

web.refresh;

Please attach your project, I'll test it.

Dmitry.

Re: Twebbrowser Control

Please can you help me with this error

Thank you

Post's attachments

Attachment icon Access Violation.png 210.64 kb, 313 downloads since 2017-04-04 

Re: Twebbrowser Control

gamalier_ramirez wrote:

Please can you help me with this error

Thank you

Please attach your project and describe steps to reproduce this error.

Dmitry.