Folks,

Hi.  You guys may want to know the solution to this issue.  If you call 
TWebBrowser.ExecWB, after it returns, you will find that the EmptyParam 
global variable is no longer the same value.  It gets set to Unassigned. 
There is a bug logged on Quality Central:

http://qc.embarcadero.com/wc/qcmain.aspx?d=61255

This is perhaps not a VCL bug per se, but more of how Delphi calls dual 
interface methods and perhaps a bug in IE itself.  The workaround is simple, 
bypass TWebBrowser.ExecWB and call the browser's ExecWB method directly, 
passing in dummy OLEVariant variables initialised to the same value as 
EmptyParam.

Regards,
Dennis.

--------------------------------------------------
From: "Edward Huang" <edwa...@slingshot.co.nz>
Sent: Wednesday, August 03, 2011 7:39 PM
To: "'NZ Borland Developers Group - Delphi List'" <delphi@delphi.org.nz>
Subject: [DUG] Strange behavour - WebBrowser and ADO

> Hi,
>
> We have just noticed a strange behaviour recently, which I couldn't figure
> out how to resolve.  The issue could have been there all the time, just we
> didn't used the sequence before.
>
> We have an application, uses ADO to connect to SQL Server database.
> Components used include TADOQuery, TADOStoreProcedure etc.  It all works
> fine.
>
> Then we have a form which contains among other things, a TWebBrowser and a
> 'Print' button.  On click event of the Print button, we call:
>
>  WebBrowser_Help.ExecWB(OLECMDID_PRINT, 1);
>
> Which will bring up printing dialog and print the contents of the
> TWebBrowser component.
>
> The strange thing is that after the Print button clicked, subsequent 
> access
> to database via ADO components all failed with Exception.  The following 
> is
> a sample exception message:
>
> Arguments are of the wrong type, are out of acceptable range, or are in
> conflict with one another
>
> I have tried to close ADOConnection, reopen etc, the database access still
> doesn't success.
>
> Anyone knows how to fix this issue?
>
> Edward
>



> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi@delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
> unsubscribe 

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

Reply via email to