RES文件中的html文件如何调用,显示在webbrowser中啊?(50分)

M

maogel

Unregistered / Unconfirmed
GUEST, unregistred user!
资源文件如下:
SRC1 FILE1 "12-1.htm"
SRC2 FILE2 "12-2.htm"
SRC3 FILE3 "12-3.htm"
载入内存:
var hResInfo : THandle;
begin
hResInfo := FindResource(HInstance, 'SRC1', 'FILE1');
hRes := LoadResource(HInstance, hResInfo);
if hRes > 32 then {its a good load}
begin {lock the resource}
ptrSound:=LockResource(hRes);
end;
在webbrowser中使用:
URL:=WideString(ptrSound);
Form2.WebBrowser1.Navigate2(URL);
//此处欲显示html文件,但使用后无反应,why???????????????
高手请教!!!!
 
〉〉URL:=WideString(ptrSound);
〉〉Form2.WebBrowser1.Navigate2(URL);
这样肯定是不行的:)

你可以把资源里的东东保存到一个临时文件里,然后Form2.WebBrowser1.Navigate2(临时文件名);
或者,把资源里的东东读到一个字符串里,然后,用WebBrowser1.document.body.innerhtml := 这个
字符串;
 
顶部