This step is only needed for older versions of Visual Studio, so it's likely you can skip it. Set the solution to use the Win10 SDK and Visual Studio toolset The above screenshot shows some WebView2 code ( #include "WebView2.h"), that's already present in the file immediately after cloning (downloading) the repo. HelloWebView.cpp opens in the code editor of Visual Studio. In Solution Explorer, expand the Source Files node, and then select HelloWebView.cpp. If the WebView2GettingStarted project isn't open in Visual Studio, open it in Visual Studio: Step 6 - View the opened project in Visual Studio The solution contains a single project: WebView2GettingStarted, which contains a single. The WebView2GettingStarted solution opens in Visual Studio. If that dialog appears, you can click OK.The Visual Studio Review Solution Actions dialog might appear, prompting you whether you want to Retarget Projects: NET desktop development card (not needed for this tutorial), so that a checkmark appears on this card as well. Select the Desktop development with C++ card so that a checkmark appears. If Visual Studio Installer prompts you to install a Workload: Visual Studio Installer might open and prompt you to install a Workload: Open WebView2GettingStarted.sln, which is located at the path: /WebView2Samples/GettingStartedGuides/Win32_GettingStarted/WebView2GettingStarted.sln. Open Visual Studio (not Visual Studio Code). We'll start with an existing app project from the WebView2Samples repo, which you cloned or downloaded from GitHub in the previous step. You start with a basic desktop project that contains a single main window. Step 4 - Open the finished solution (WebView2GettingStarted.sln) Then return here after you've copied the repo to your local drive, and continue with the steps below. To do this, in a separate window or tab, follow the steps in Download the WebView2Samples repo or Clone the WebView2Samples repo in Set up your Dev environment for WebView2. If you haven't already, clone or download the WebView2Samples repo.For information about the underlying, standard Win32 app sample, in a new window or tab, see Walkthrough: Create a traditional Windows Desktop application (C++).Ĭlone or download the WebView2Samples repo, as follows: The existing Visual Studio project we'll start with is part of the sample code from a standard C++ Win32 desktop application. We'll add WebView2 features - actually, the features have already been added, but follow along in the setup and explanation steps. To keep this tutorial focused on WebView2-specific coding, we start from an existing Microsoft Visual Studio project ( WebView2GettingStarted) that's stored in the WebView2Samples GitHub repo. An optional step below allows you to delete the WebView2 code from HelloWebView.cpp, so that you can add it yourself, if you want. The code that you add in this tutorial's steps, has already been added to the sample repo, for you. Step 3 - Clone or download the WebView2Samples repo To do that, in a new window or tab, see Install a preview channel of Microsoft Edge in Set up your Dev environment for WebView2. If it's not installed already, install a preview channel of Microsoft Edge.Step 2 - Install a preview channel of Microsoft Edge Then return to this page and continue below. Follow the steps there to do a basic default installation of Visual Studio. If Microsoft Visual Studio isn't installed already, in a new window or tab, see Install Visual Studio in Set up your Dev environment for WebView2.This tutorial requires Microsoft Visual Studio, not Microsoft Visual Studio Code. Solution file: WebView2GettingStarted.sln.The completed tutorial project is available in the WebView2Samples repo: Instead, you start with the completed project that's in the repo. This tutorial does not have you create a new project you don't use a project template in Visual Studio to create a new project. Follow the remaining steps in this article about adding and understanding the WebView2 code.Optionally delete the WebView2 code from HelloWebView.cpp to restore the Win32 baseline app.Clone or download the WebView2Samples repo to your local drive.To use this article, you do the following: The project uses the Win32_GettingStarted (WebView2GettingStarted.sln) directory that's part of the WebView2Samples repo. This tutorial starts by opening an existing Win32 app project that has WebView2 code added. In this article, you set up your development tools (if not done already), learn how to add WebView2 code to a Win32 app project, and learn about WebView2 concepts along the way.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |