예제 #1
0
 /// <summary>
 /// Create an instance
 /// </summary>
 /// <param name="pUnkOuter"></param>
 /// <param name="riid"></param>
 /// <param name="ppvObject"></param>
 public void CreateInstance(IntPtr pUnkOuter, ref Guid riid, out IntPtr ppvObject)
 {
     if (riid == IID_IInternetProtocol || riid == IID_IUnknown)
     {
         object ctrl = ((IProtocolFactory)_currentFactory).GetIInternetProtocol();
         ppvObject = Marshal.GetComInterfaceForObject(ctrl, typeof(Interop.IInternetProtocol));
     }
     else if (riid == IID_IInternetProtocolInfo)
     {
         HttpProtocolInfo ctrl = new HttpProtocolInfo();
         ppvObject = Marshal.GetComInterfaceForObject(ctrl, typeof(Interop.IInternetProtocolInfo));
     }
     else if (riid == IID_InternetSession)
     {
         InternetSession ctrl = new InternetSession();
         ppvObject = Marshal.GetComInterfaceForObject(ctrl, typeof(Interop.IInternetSession));
     }
     else
     {
         ppvObject = IntPtr.Zero;
         Marshal.ThrowExceptionForHR(E_NOINTERFACE);
     }
 }
예제 #2
0
 public InternetSessionFactory(IHtmlEditor editor)
 {
     this.editor = editor;
     _client     = new InternetSession(editor);
 }