Jump to content
  • Advertisement
Sign in to follow this  
meeshoo

bar file

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

ok, sorry i keep talking about this, but can somebody tell me how to work with this .bar files? i want to use them for loading images. what i've don till now is: i've created a resource file, in the binary category i've created a resource of type image from a .bmp file, then i've compiled the resource file(successfully) and copy it and it's .brh file into my project folder. all letters are lowercase. next, i've included the brh into my project and then tried something like void * tmp = ISHELL_LoadResData(shell, "name of the file", ID_RESOURCE, RESTYPE_IMAGE); after this tmp gets NULL. why is this happening? please help.

Share this post


Link to post
Share on other sites
Advertisement
is you shell variable set with a valid value ? I am using LoadResDataEx instead of LoadResData because it give extra info but I dont see any reason why that's not working in your case. Here is the method I use to load all my resources - works perfectly with images :

char* Util::loadResource( const char* resourceFilename, int32 id, ResType type , uint32* size)
{
char* resBytes = (char*) ISHELL_LoadResDataEx( getShell(), resourceFilename, (short) id, type, 0, size );
if ( 0 == *size || 0 == resBytes )
{
return 0;
}

return resBytes;
}

if that doesnt solve your problem then zip your project and send it to me (armisen@hotmail.com) and I'll have a look at it.

f.


Quote:
Original post by meeshoo
ok, sorry i keep talking about this, but can somebody tell me how to work with this .bar files? i want to use them for loading images.

what i've don till now is:
i've created a resource file, in the binary category i've created a resource of type image from a .bmp file, then i've compiled the resource file(successfully) and copy it and it's .brh file into my project folder. all letters are lowercase. next, i've included the brh into my project and then tried something like
void * tmp = ISHELL_LoadResData(shell, "name of the file", ID_RESOURCE, RESTYPE_IMAGE);

after this tmp gets NULL. why is this happening?

please help.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
This may seem like a stupid suggestion, but when you tell me the function you are calling, I note that you have ID_RESOURCE, I assume that you are in fact putting in the value here for the given resource, which is shown in the resource editor.

Share this post


Link to post
Share on other sites
the problem was that i was using the resource as binary(in the bar file) and not object. in fact, there is a sticky thread with this, it's not only me having problems with that. i'm working with resources since many years ago, i know how to load a resource and what is that a resource id. just that i never programmed on any other platform except Windows.

[Edited by - meeshoo on October 7, 2004 3:23:20 PM]

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.

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!