将应用程序(exe 文件)嵌入到另一个 exe 文件中(类似 mozEmbed)
我想将 mozilla firefox 嵌入到我的应用程序中,而不使用任何 activex 控件(TWebBrowser 包装器、mozilla ActiveX...)。我尝试使用 TWebBrowser(实际上 bsalsa 的嵌入式 webBrowser 效果更好),但所有版本的 IE 似乎与流行的 javascript 框架和库(JQuery、ExtJS...)的某些功能不兼容。
我的问题是:我可以从我的应用程序中调用 firefox 的 Exe(是否可以使用 DDE 或 OLE),最重要的是使用 TFrame 或类似的东西在我的应用程序中显示它?
等待您的建议 问候,M
I would like to embed mozilla firefox into my application WITHOUT using any activex control (TWebBrowser wrapper, mozilla ActiveX...). I tried using TWebBrowser (actually bsalsa's embedded webBrowser wich is by far better), but all versions of IE seem incompatible with some features of popular javascript framework and libs (JQuery, ExtJS...).
My question is : can I call firefox's Exe from my application (is it possible with DDE or OLE) and above all SHOW IT inside my app using a TFrame or anything similar ?
waiting for your suggestions
Regards, M
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您需要稍微清理一下代码,并弄清楚如何与 Firefox 进行“对话”。
但这里介绍了如何将任何应用程序嵌入到 Delphi 表单中。
DFM 文件
main.pas 文件
You'll need to clean up the code a bit and work out how you'll "talk" to Firefox.
But here is how you can embed any app inside a Delphi form.
DFM File
main.pas file
您可以将 DLL 嵌入到您的应用程序中并“加载”,然后使用 BTMemoryModule.pas(只需 google 即可找到)。
如果这个 DLL 是一个 COM 对象,它可能会“加载”COM DLL 工厂并获取所需的 COM 接口的实例:
我不知道如何嵌入可执行文件。
我希望这些信息有帮助。
You can embed DLLs into your application and "load" then using BTMemoryModule.pas (just google it and you find it).
If this DLL is a COM object it might work to "load" the COM DLL factory and obtaining an instance of the COM interface you want:
I do not know how to embed executables.
I hope this info helps.
将 EXE 嵌入应用程序的最简单方法是将其添加为资源。
使用类似以下文本的内容创建一个 .RC 文件:
然后使用 brcc32.exe,您可以编译一个与 .RC 同名的 .RES 文件,然后您可以使用该文件在您的应用程序中包含 ($I) 新的 .RES 文件。 NAMEOFOTHER.EXE 必须与 .RC 文件位于同一文件夹中,或者路径正确,IIRC。
据说还有另一种方法可以做到这一点。
您不使用命令行 brcc32.exe 编译器,只需将 .RC 文件包含 ($I) 到您的程序中,编译器就会动态编译 .RC 文件。
无法告诉你第二种方法是否有效,因为我从未尝试过。
The simplest way to embed an EXE into your application is to add it as a resource.
Make a .RC file with something like the following text:
then using brcc32.exe you can compile a .RES file of the same name as the .RC with which you can then include ($I) the new .RES file in your application. The NAMEOFOTHER.EXE has to be in the same folder as the .RC file or be properly pathed, IIRC.
There is supposededly another way of doing this as well.
You don't use the command line brcc32.exe compiler and just include ($I) the .RC file into your program and the compiler the compiles the .RC file on the fly.
Can't tell you if the second method works or not as I've never tried it.
我认为最初的人真正想要的是一个作为控件嵌入到他的应用程序中的 Web 浏览器渲染引擎。如果是这样,Gecko(mozilla 渲染部分)可以作为您的应用程序的插件。我认为你不想运行 EXE。
例如,Mozilla Firefox 不仅仅是一个 EXE 文件,还需要其他东西,包括配置文件文件夹。您可能还没有考虑到可能导致的所有问题。
如果您只想要一个网络浏览器控件,这不是方法。试试这个:
http://ftp.newbielabs.com/Delphi%20Gecko%20SDK/
https://sourceforge.net/projects/d-gecko/
I think what the original guy actually wants is a Web browser rendering engine embedded as a control in his application. If so, Gecko (The mozilla rendering part) is available as a plugin for your Application. I don't think you want to run an EXE.
For example, Mozilla Firefox isn't just an EXE file, but requires other stuff including a profiles folder. YOu probably haven't thought about all the problems that would cause.
If you just want a web browser control, this is not the way to do it. Try this instead:
http://ftp.newbielabs.com/Delphi%20Gecko%20SDK/
https://sourceforge.net/projects/d-gecko/