如何访问资源dll中的文件
我在 Visual Studio 2005 中使用 Visual C++ 创建了 IE 插件的资源 DLL,但无法访问 DLL 中的文件(html 和图标)。我尝试过使用和不使用资源文件,但仍然无法访问它们。 设置 /NOENTRY 选项,因为它是资源 dll。 为了访问资源,我使用与此类似的路径: “res://C:\Program Files\MyApp\MyDLL.dll/myfile.htm” 但它似乎不起作用。 我是否错过了一步,或者有什么地方做得不对? 请告诉我。
谢谢,
奥利维尔。
I have created a resource DLL for an IE addon with Visual C++ in Visual Studio 2005, but I cannot access the files (html and icons) within the DLL. I tried with and without a resource file but I still haven't been able to access them.
the /NOENTRY option is set, since it is a resource dll.
to access the resources I use a path similar to this:
"res://C:\Program Files\MyApp\MyDLL.dll/myfile.htm"
but it does not seem to work.
Did I miss a step or is there something I'm not doing right?
Please let me know.
Thanks,
Olivier.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我再次找到了解决问题的方法。
语法“res://C:\Program Files\MyApp\MyDLL.dll/myfile.htm”是正确的,但不知何故它对我不起作用。然后我将其更改为“res://C:\Program Files\MyApp\MyDLL.dll/100”,其中 100 是资源的“值”(资源文件中的每个资源都有一个 ID 和一个值)。要了解 VS 2005 中的资源值是多少,请切换到资源视图,右键单击要了解其值的资源文件,然后选择“资源符号”。
Once again, I found the solution to the problem.
The syntax "res://C:\Program Files\MyApp\MyDLL.dll/myfile.htm" is correct but somehow it was not working for me. Then I changed it ti "res://C:\Program Files\MyApp\MyDLL.dll/100" where 100 is the 'value' of the resource (every resource in a resource file has an ID and a value). To find out what your resource value is in VS 2005, switch to resource view, right click on the resource file that you want to know the value of and select 'resource symbols'.