私は非常に単純なプロジェクトを開始しています。基本的には、公開端末で使用するための URL がハードコードされた Web ブラウザーです。つまり、C# の Web ブラウザー コントロールで自殺したくなければ、それは簡単なことでした。
Skybound Gecko ブラウザーを使用することにしました。これが唯一の実行可能な代替手段のように思われるためです.. このプロジェクトでいくつかの学習曲線を経て、いくつかの「スターター」エラーを回避しました (つまり、ウィンドウハンドルを設定する前にナビゲートできません)。 、およびxpcom.dllが見つからない場合のエラー)、およびそれらを修正しました
ここで、アプリケーションを実行して Skybound Gecko コントロールで URL を開くと、Program.cs でエラーが発生します。
また、補足として、私は Stylizer 5 をインストールしましたが、それは Skybound プロジェクトを適切に利用しているので、私のコードまたは構成に含まれていると思います。
どんな援助でも大歓迎です。
Program.cs (エラーが表示される場所)
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: