🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

bar file

Started by
2 comments, last by meeshoo 19 years, 9 months ago
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.
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.
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.
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]

This topic is closed to new replies.

Advertisement