How do I go about exposing IConnectionPointContainer on extended
forms.webbrowser?

Please pardon my shallow experience in I whatever interface.  I am
clueless. tried google but nohtingnhelped so far for the lack of proper
search term.


Using vb.net 2005 express with dotnet 2 and windows.forms.webbrowser,  I
was attempting to automate some data gathering from https websites once
user logs in.



I tried to extend the windows.forms.webbrowser to make availabble
newwindows2 and extended naviggtion so I can control and pass seesion
information when the https website tries creates new window by script.



I chose the forms.webbrowser because

1. the applicaiton initially was designed for it and work very well until
hitting https website that pops up new windows which become IE instances.
That of course does not have the required session security context and
become non displayable

2. the form using the webbrowser was using an encapsulated user control
with webbrowser so I can easily plug this new extension without trouble -
so I thought



Now the problem I am facing is I get the following message about 4 or 5
time whever I bring up the designer view of the formAnApp

---------------------------
Exception error in createSink of anApp.WebCtlExt
---------------------------
Source object does not expose IConnectionPointContainer.

System.Windows.Forms   at
System.Windows.Forms.AxHost.ConnectionPointCookie..ctor(Object source,
Object sink, Type eventInterface, Boolean throwException)

   at System.Windows.Forms.AxHost.ConnectionPointCookie..ctor(Object
source, Object sink, Type eventInterface)

   at myApp.WebCtlExt.CreateSink() in c:\AppCom\anApp\webCtlExt.vb:line 114
---------------------------
OK
---------------------------


the problematic code is in the class WebCtlExt and the form formAnApp  uses

1. webCtlExt and

2 webCtl which is a usercontrol with tabcontrol.  the tabcontrol's main
(first) tab page i has an instance of webCtlExt

webctl and webCtlExt can both be opened in dsigner without problem.


the problematic code for create sink is as follows

   'This method will be called to give you a chance to create your own
event sink
    Protected Overrides Sub CreateSink()
        'MAKE SURE TO CALL THE BASE or the normal events won't fire
        MyBase.CreateSink()
        wevents = New WebBrowserExtendedEvents(Me)
        'cookie = New AxHost.ConnectionPointCookie(Me.ActiveXInstance,
wevents, GetType(DWebBrowserEvents2))
        'Dim ao As Object = GetType(DWebBrowserEvents2)
        'Dim axcookie As AxHost.ConnectionPointCookie = New
AxHost.ConnectionPointCookie(Me, wevents, Me.webbrowserExtendedEvents)
        Try
            'cookie = New AxHost.ConnectionPointCookie(Me.ActiveXInstance,
wevents, GetType(DWebBrowserEvents2))
            cookie = New AxHost.ConnectionPointCookie(Me, wevents, GetType
(DWebBrowserEvents2))
        Catch e As Exception
            MessageBox.Show(e.Message & vbCrLf & e.Source & e.StackTrace, _
                "Exception error in createSink of " & Me.Name,
MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Stop)
        End Try

    End Sub





I could not use the activeXinstance - it gave same error.  furthermore I do
not get control newwnidow when I do run the app.

How do I go about exposing IConnectionPointContainer?
or is there a better way of using forms webbrowser and still allow me
contorl of navigation and newwindow? in the existing application

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to