Board index » delphi » IE, ActiveX, Certificate Dialog shown twice - rather difficult

IE, ActiveX, Certificate Dialog shown twice - rather difficult


2005-01-11 07:32:35 AM
delphi67
Hello!
I'm having some difficulties showing ActiveX inside Internet Explorer when
using HTTPS (SSL) protocol or better yet, downloading files with these
ActiveX control and (not) showing "Select certificate" dialog. My ActiveX
downloads some files and shows them inside itself. The whole page and also
ActiveX resides on IIS 6.0, running over HTTPS protocol. The problem is,
that certificate selection dialog appears first time when browser gets to
HTTPS location, and the second time, when ActiveX control tries to download
files from HTTPS (the same server, the same site). The problem must be in
ActiveX control not using same Internet Explorer session as the rest of the
page does. So basicly, how can I "connect" to existing IE session (already
having present certficate info) inside ActiveX control, embedded inside IE
page, so that I won't get the "Select certificate" dialog the second time
e.g. when ActiveX control will try to download files? I don't (must?) not
let user select the same certificate again when ActiveX control tries to
download some files, since this is not neccessery, because the user already
selected certificate when he was navigating to this page.
I'm using URLOpenStream to download files with IBindStatusCallback (ActiveX
control actually opens another thread to download files and in this thread
URLOpenStream gets called) set to an object that supports these interfaces:
IUnknown
IBindStatusCallBack
IAuthenticate
IHttpNegotiate
IHttpSecurity
IServiceProvider
IWindowForBindingUI
I've searched all of the MSDN (I think?), google groups and general
internet, but I cannot seem to find a solution to this problem. Could anyone
give me any pointers in right direction? I am thinking of looking into
interface marshalling functions, but I don't know if this is the way, so if
anybody has any suggestions, they are more than welcome!
The closest I could get, was trying to obtain a pointer to Explorer's
IBindHost interface (needed in URLOpenStream as the first parameter; got it
from MSDN), but when calling IOleClientSite.GetContainer (should be followed
by IOleContainer.QueryInterface(IServiceProvider) and then
IServiceProvider.QueryService(SID_SBindHost, IID_IBindHost, obj) ) I got an
error "RPC_E_WRONG_THREAD" ($8001010E)
Using Delphi 7 on Win2003, IIS 6.0, IE 6.0 (should also work on IIS 5.0, IE 5.0,
Win2K, Windows XP ?)
TIA
regards,
Jure
 
 

Re:IE, ActiveX, Certificate Dialog shown twice - rather difficult

this might work...
URLOpenStream(IUnknown(VCLComObject), , , ,); // from unit URLMON.PAS
Dennis Passmore
Ultimate Software, Inc.