Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

nosajghoul

wanted : resource tutorial

This topic is 5558 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ive been playing around with attaching resources to a project, and for some reason I cant get it to work. (Prolly something stupid... again) I use VC++ 6, and am trying to attach custom resources to a project (.x files, .png files, .wav files mostly). Maybe Im misunderstanding something. A nice step by step would be great, so Ive spent the last hour on google and yahoo and msdn.microsoft looking for this, but they invariably confuse the hell out of you (well, me anyhow). Theres a decent one here on gamedev, but it leaves gaps. (for example : where does the resource.h file come in) Anyone know of a good tutorial on this or can write it out step by step? Thanks. -Jason

Share this post


Link to post
Share on other sites
Advertisement
A resource file''s contents are typically defined by a script, i.e. your_program.rc.

When you have to load something from a resource, you commonly call functions related to it; LoadResource, (Un)LockResource, EnumResources, and so on. You use the macro, MAKEINTRESOURCE, to refer to a resource by its ID (which are usually defined in resource.h). Any of these functions will use a HGLOBAL memory reference (as opposed to a void pointer), though you can use LockResource to obtain a void* to the memory.

That should give you a start. Good luck!



MatrixCubed
http://MatrixCubed.cjb.net

Share this post


Link to post
Share on other sites
Good info.

Heres where Im at now :

I have a file I want to add as a resource. (whatever.x) In a MSVC++ 6.0 project, I go to Insert-->Resource (Ctrl-R), and a menu in a window pops up. I choose Import. Another window pops up, allowing me to choose a file. The default type is .ico, so I change "Files of type" from .ico to All Files (*.*). That lets me see the whatever.x file, which I double click on. This causes another window to pop up, prompting me to type in a resource type. I put in XFILE and hit OK. This causes the file to be viewed, in hex format. All is well so far... I think.

However, on the "workspace" (you know, the mini window with class view, file view and resource view) there is NO resource view tab. Also, there is no resource.h in the file view.

So then I play around, and eventually I find Project-->Add To Project-->New, which pops up with a menu, and I choose Resource Script. I put in the name "rs". Now theres a resource view tab, and Im stuck on what to do next.

lost
-Jason


Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!