2016-07-27 7 views
0

guter Tag allFehler in cef in C# Fenstern bilden

Ich habe versucht, meine GUI in C# unter Verwendung der WebBrowser-Komponente zu aktualisieren, aber es funktioniert nicht alles und die Datei tut Show zu unterstützen, wie es

sein sollte

so habe ich versucht ChromiumWebBrowser verwendet, die eine große Lösung

zu sein schien, aber wenn ich das Projekt kompiliert es justs Ausfahrten ohne Fehler

public ChromiumWebBrowser chromeBrowser; 

    public void InitializeChromium() 
    { 
     CefSettings settings = new CefSettings(); 

     // Note that if you get an error or a white screen, you may be doing something wrong ! 
     // Try to load a local file that you're sure that exists and give the complete path instead to test 
     // for example, replace page with a direct path instead : 
     // String page = @"C:\Users\SDkCarlos\Desktop\afolder\index.html"; 

     String page = string.Format(@"{0}\html-resources\html\mainmenu.html", Application.StartupPath); 
     //String page = @"C:\Users\SDkCarlos\Desktop\artyom-HOMEPAGE\index.html"; 

     if (!File.Exists(page)) 
     { 
      MessageBox.Show("Error The html file doesn't exists : " + page); 
     } 

     // Initialize cef with the provided settings 
     Cef.Initialize(settings); 
     // Create a browser component 
     chromeBrowser = new ChromiumWebBrowser(page); 

     // Add it to the form and fill it to the form window. 
     this.Controls.Add(chromeBrowser); 
     chromeBrowser.Dock = DockStyle.Fill; 

     // Allow the use of local resources in the browser 
     BrowserSettings browserSettings = new BrowserSettings(); 
     browserSettings.FileAccessFromFileUrls = CefState.Enabled; 
     browserSettings.UniversalAccessFromFileUrls = CefState.Enabled; 
     chromeBrowser.BrowserSettings = browserSettings; 
    } 

und diese

public void InitializeChromium() 
    { 
     CefSettings settings = new CefSettings(); 
     Cef.Initialize(settings); 
     chromeBrowser = new ChromiumWebBrowser("http://stackoverflow.com/"); 
     this.Controls.Add(chromeBrowser); 
     chromeBrowser.Dock = DockStyle.Fill; 
    } 

und die Funktion nach dem InitializeComponent

genannt Dies ist, was nach

The thread 'vshost.NotifyLoad' (0x7bc) has exited with code 0 (0x0). 
The thread '<No Name>' (0x315c) has exited with code 0 (0x0). 
The thread 'vshost.LoadReference' (0x1004) has exited with code 0 (0x0). 
'cefTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'c:\users\dark_\onedrive\documents\visual studio 2012\Projects\cefTest\cefTest\bin\x64\Debug\cefTest.exe', Symbols loaded. 
'cefTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'c:\users\dark_\onedrive\documents\visual studio 2012\Projects\cefTest\cefTest\bin\x64\Debug\CefSharp.Core.dll' 
'cefTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'c:\users\dark_\onedrive\documents\visual studio 2012\Projects\cefTest\cefTest\bin\x64\Debug\CefSharp.WinForms.dll' 
'cefTest.vshost.exe' (Managed (v4.0.30319)): Loaded 'c:\users\dark_\onedrive\documents\visual studio 2012\Projects\cefTest\cefTest\bin\x64\Debug\CefSharp.dll' 
The program '[8200] cefTest.vshost.exe: Managed (v4.0.30319)' has exited with code -2147483645 (0x80000003). 

Hoffnung verlass zeigt, dass jemand

+0

kann jeder hilf mir :( –

+0

Benutzt du 'CefSharp'? Wenn ja, müssen Sie Ihre Fragen entsprechend kennzeichnen. Einige grundlegende Arbeitsbeispiele finden Sie unter https://github.com/cefsharp/CefSharp.MinimalExample. – amaitland

Antwort

0

sicher, dass Sie dieselbe verwenden Make helfen können .Net FrameWork (4.5.2) oder mehr