Skip to main content
gamedev.net
🔒 Locked

bar file

Started by meeshoo Oct 4, 2004 at 3:54 AM 2 replies 3.8k views
Original Post
meeshoo
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.
mister_fab
mister_fab
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.
meeshoo
meeshoo
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]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.