代码之家  ›  专栏  ›  技术社区  ›  Dutchie432

Skybound Gecko项目:尝试读取或写入受保护的内存

  •  1
  • Dutchie432  · 技术社区  · 14 年前

    现在,当我运行应用程序并在一个Gecko控件中打开URL时,我在程序.cs.

    另外,顺便说一句,我安装了Stylizer5,它正确地利用了Skybound项目,所以我假设它在我的代码或配置中。

    任何协助都将不胜感激。

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Windows.Forms;
    
    namespace alphaCommKiosk
    {
        static class Program
        {
            /// <summary>
            /// The main entry point for the application.
            /// </summary>
            [STAThread]
            static void Main()
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
    
                //Error Line--------------------------------------------
                Application.Run(new Form1()); //  <--- ERROR OCCURS HERE.
            }
        }
    }
    

    相关代码

        //webBrowser1 is a control dragged onto the form
        //Intialize
        string path = "C:\\Program Files (x86)\\xulrunner\\";
        Skybound.Gecko.Xpcom.Initialize(path);
        webBrowser1 = new Skybound.Gecko.GeckoWebBrowser();
        webBrowser1.CreateControl();
        string u = "http://www.domaion.com/kiosk/index.php?account=" + mAccount + "&hash=" + mHash;
    
        //Navigate
        webBrowser1.Navigate("http://www.ibm.com/");
        //execution actually progresses past this line to the end of the sub
    

    完整错误和堆栈跟踪

       System.AccessViolationException was unhandled
      Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
      Source=System.Windows.Forms
      StackTrace:
           at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
           at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.Run(Form mainForm)
           at alphaCommKiosk.Program.Main() in c:\code\alphaCommKiosk\alphaCommKiosk\Program.cs:line 18
           at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException: 
    
    1 回复  |  直到 12 年前
        1
  •  0
  •   Dutchie432    14 年前

    我可以通过切换到WebKit组件来解决这一整天的问题。坦白地说,如果我是第一个发现这个的话,我会更喜欢“chrome风格”的控件而不是FireFox。

    http://webkitdotnet.sourceforge.net/downloads.php

    超级容易安装,没有任何问题 xulrunner公司 垃圾