C++ 如何在窗口中嵌入 WebKit?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7311435/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 16:46:50  来源:igfitidea点击:

How do I embed WebKit in a window?

c++windowsvisual-studiowebkit

提问by Tower

Possible Duplicate:
How to embed WebKit into my C/C++/Win32 application?

可能的重复:
如何将 WebKit 嵌入到我的 C/C++/Win32 应用程序中?

I am trying to embed the WebKit project into my solution. At first I'd like to just render the Webkit inside a typical window and make it load some pseudorandom URI.

我正在尝试将 WebKit 项目嵌入到我的解决方案中。起初,我只想在一个典型的窗口中呈现 Webkit 并让它加载一些伪随机 URI。

I tried checkouting the sources from http://svn.webkit.org/repository/webkit/trunk/Source/and I got immediately confused on what headers to include. I begin with webkit/win/WebView.hand it threw an error saying could not include Webkit.hFair enough, there's no such file... then I begin reading official documentation, but found out there is none except for Objective-C which doesn't even state what to include for what functionality.

我尝试从http://svn.webkit.org/repository/webkit/trunk/Source/检出源代码,但我立即对要包含哪些标头感到困惑。我开始时webkit/win/WebView.h它抛出了一个错误说不能包含Webkit.h公平,没有这样的文件......然后我开始阅读官方文档,但发现除了Objective-C之外没有任何内容,它甚至没有说明要包含的内容什么功能。

I'm working on Visual Studio 2010 and Windows 7. Eventually I'd like the project run on Linux, but that requirement is off the table right now.

我在 Visual Studio 2010 和 Windows 7 上工作。最终我希望项目在 Linux 上运行,但现在这个要求不在表中。

I tried googling for help which did not really show up any results with code samples or information on what I should actually do.

我尝试使用谷歌搜索寻求帮助,但并没有真正显示代码示例的任何结果或有关我实际应该做什么的信息。

I am not interested in Qt, nor Gecko.

我对 Qt 和 Gecko 不感兴趣。

I guess I want to use WebView, but I have really no idea how and my C++ skills are rusty and all I know are concepts, I haven't done much anything with the language.

我想我想使用 WebView,但我真的不知道我的 C++ 技能是如何生疏的,我所知道的只是概念,我没有用这种语言做太多事情。

采纳答案by Brian Lyttle

There is an accepted answer for "How to embed WebKit into my C/C++/Win32 application?". I think it might be the best place to start. IIRC WebKit provides various interfaces for different features and you need to make sure that you have implementations for all the ones that you require in your application.

“如何将 WebKit 嵌入到我的 C/C++/Win32 应用程序中?”有一个公认的答案。. 我认为这可能是最好的起点。IIRC WebKit 为不同的功能提供了各种接口,你需要确保你的应用程序中所有需要的实现都有。

ChromiumEmbeddedmight be worth a look, but there could be variations in the WebKit implementations.

ChromiumEmbedded可能值得一看,但 WebKit 实现可能会有变化。

回答by bfulgham

I maintain a Windows port of WebKit (in the WebKit repository) that replaces the various Apple-specific libraries so that it can be freely redistributed.

我维护了一个 WebKit 的 Windows 端口(在 WebKit 存储库中),它替换了各种 Apple 特定的库,以便可以自由地重新分发。

I posted some example codethat shows how to embed WebKit in a pure WinAPI program. The repository also includes a version of the WebKit DLLs, header files, and link libraries needed to use it.

我发布了一些示例代码,展示了如何在纯 WinAPI 程序中嵌入 WebKit。该存储库还包括使用它所需的 WebKit DLL、头文件和链接库的一个版本。