Aaron Benzel
Aaron Benzel

Reputation: 311

How to setup Chromium Embedded for Visual Studio?

I'm a newbie to CEF and am wanting to build the "cefsimple" example in Visual Studio but I can't find any .sln file. how does someone setup the development environment?

Upvotes: 1

Views: 2842

Answers (2)

Matt
Matt

Reputation: 621

In order to use the Chromium Embedded Framework you must make your own solution .sln file. You can use CMake to do it.

I would recommend the GUI version if you aren't familiar with it. Just point CMake to the project directory (Cef) and generate a solution file. You should get ALL_BUILD, CefClient, CefSimple, LibCef_Wrapper and ZeroCheck projects when you open the Cef Source.

Upvotes: 2

Daniel
Daniel

Reputation: 11054

I used Nuget to get the packages:

Menu goodness

Nuget CEF goodness

I then set up a control like so (I'm using WPF):

<UserControl x:Class="WebpageViewer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:cefSharp="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="300">
  <Grid>
    <cefSharp:ChromiumWebBrowser Address="www.google.com" />
  </Grid>
</UserControl>

And made sure to call Cef.Initialize() before InitializeComponent in the constructor for the control:

Cef.Initialize(New CefSettings())

Upvotes: 1

Related Questions