Jump to content
  • Advertisement
Sign in to follow this  
Fire Lancer

Using resource files in VS2008

This topic is 3325 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

I cant seem to find any easy to follow instructions on this subject that will allow me to do either of the things I want to. 1)Include various files in the exe (icons, textures, etc) that I can load using the windows and directX apis (ie D3DXCreateTextureFromResource 2)Include various files in the exe which I can read with a std::ifstream I get the bit about createing the .rc file, and resource.h, which gives me a bunch of defines eg "#define IDR_HTML_TEST 102", but I cant see how I then use that in my application, all the API methods that want a resource want a string, not an integer, and I have even less idea how to make a file stream from it...

Share this post


Link to post
Share on other sites
Advertisement
I just tried that but the function fails.
D3DX10: The specified resource name cannot be found in the image file.


D3DX10CreateEffectFromResource(
Module, MAKEINTRESOURCE(IDR_FX_SIMPLE), L"simple.fx",
NULL, NULL, "fx_4_0", shaderFlags, 0, device, NULL, NULL, &effect, NULL, NULL);



Module is from the HINSTANCE that was passed to DllMain (since HMODULE == HINSTANCE under win32).


The entry in the .rc file is as follows:
IDR_FX_SIMPLE           RCDATA                  "simple.fx"



EDIT: Also I figured out problem 2, I can get a pointer to the resources data (LockResource) and its size(SizeofResource) and then write that to a std::stringstream, which I can then use with my existing file parsing methods.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!