如何从Borland C ++(Rad Studio)Twebbrowser组件中的资源加载html文件 [英] How to load html file from resource in borland c++(Rad Studio) Twebbrowser Component

查看:44
本文介绍了如何从Borland C ++(Rad Studio)Twebbrowser组件中的资源加载html文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我与rad studio xe 2 borland c ++合作
我制作了一个资源文件,并添加了一个html文件作为RCDATA
我想将该html文件加载到Twebbrowser组件
但是我不知道该怎么办?如何将html文件加载到twebbrowser中读取
有人帮我举个例子,请
对不起,我的英语不好
感谢

Hi
I work with rad studio xe 2 borland c++
I made a resource file and added a html file as a RCDATA
I want to load that html file to Twebbrowser component
But i don''t know what should i do? How can i load that html file to twebbrowser read it
Someone help me With an example ,please
sorry for my bad english
Thanks

推荐答案

看看信息:Res的语法:协议和一些已知的相关问题 [ ^ ]和 res协议 [
Have a look at INFO: Syntax of the Res: Protocol and Some Known Related Issues[^] and res Protocol[^]

Best regards
Espen Harlinn


但这对我不起作用,这是我的代码

//------------------------------------------------ ---------------------------

#include< vcl.h>
#pragma hdrstop

#include"Unit5.h"
//------------------------------------------------ ---------------------------
#pragma package(smart_init)
#pragma资源"* .dfm"
#define HTML1 12
TForm5 * Form5;
//------------------------------------------------ ---------------------------
__fastcall TForm5 :: TForm5(TComponent *所有者)
:TForm(所有者)
{
}
//------------------------------------------------ ---------------------------
void __fastcall TForm5 :: FormCreate(TObject * Sender)
{
WebBrowser1-> Navigate("Res://Project5.exe//#12");
}
//------------------------------------------------ ---------------------------
But it does not work for me here is my code

//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit5.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
#define HTML1 12
TForm5 *Form5;
//---------------------------------------------------------------------------
__fastcall TForm5::TForm5(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm5::FormCreate(TObject *Sender)
{
WebBrowser1->Navigate("Res://Project5.exe//#12");
}
//---------------------------------------------------------------------------


这篇关于如何从Borland C ++(Rad Studio)Twebbrowser组件中的资源加载html文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆