Visual C中的其他资源类型 [英] Misc resource types in Visual C

查看:91
本文介绍了Visual C中的其他资源类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS 2008中使用C ++,通常将.bmp文件添加到资源文件.rc中.但是现在我想添加.txt文件,.wav等.但是我不知道该怎么办,有人可以帮助我吗?

添加资源文件是一项工作,使用资源是另一项工作.因此,我想知道如何使用它.例如,如何从资源读取.txt文件.

我希望你能帮助我.非常感谢!

I use C++ in VS 2008, I usually add .bmp file into resource file .rc. But now I want to add .txt file, .wav and so on. But I don''t know how to, can anybody help me ?

Adding resource files is one work, using resources is a another work. Therefore I want to know how to use it. For example how to read .txt file from resource.

I hope you can help me. Thank you so much !

推荐答案

要添加特殊资源,请在选择 Add Resource后选择Custom.

要使用这些资源,可以按顺序使用以下API.
FindResource-将类型参数用作RT_RCDATA.
LoadResource

LockResource


LockResource返回的指针可用于复制.txt或.wav内容.
To add special resources, select Custom after selecting Add Resource.

To use these resources you can use the following APIs in order.
FindResource - Use type parameter as RT_RCDATA.
LoadResource

LockResource


The pointer returned by LockResource can be used to copy the .txt or .wav contents.


这篇关于Visual C中的其他资源类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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