Page 1 of 1

Resources, again - help pelase @:-)

PostPosted: Jun 13, 2002 @ 2:34am
by Guest

PostPosted: Jun 13, 2002 @ 2:38am
by Guest

PostPosted: Jun 13, 2002 @ 2:40am
by brendan

Hi Brendan

PostPosted: Jun 13, 2002 @ 8:38am
by Conan
We are going through the same learning curve you & I. I'm using string table resources & making similar mistakes.

I guess the answer is in what you are trying to pass the resource item to. It wants an int ponter & you are giving it a char pointer & the conversion won't work.

After trying everything I could think of to solve my loadstring issue I went looking through the supplied sample projects & on examining one discovered that what I thought was a bug with the way I was defining a string was actually to do with the way I was defining the length of the string.

If you have not solved this yet let me know & I will duplicate & assist

PostPosted: Jun 14, 2002 @ 5:45am
by Guest
Not yet, no matter what I do it just crashes....

I'm looking into the diffs between the Player_Load and Player_LoadFP.... too see what the diffs are etc.

-Brendan

PostPosted: Jun 14, 2002 @ 6:35am
by Dan East

PostPosted: Jun 18, 2002 @ 1:37am
by brendan

PostPosted: Jun 18, 2002 @ 2:40am
by Dan East
I see the problem. Player_Load only supports reading from an actual file. I can think of two solutions. First, you can dump the resource to a temp file, then have MikMod load that file. It would only take a couple lines of code to implement that, and you could delete the file after you are done playing the mod. The other is to take a deeper look at the MikMod library, and either modify it to load directly from a resource, or see if you can pass it a raw chunk of memory and load from that stream instead of opening a file stream. The latter is what you are actually trying to do if you use the last suggestion I posted.

Dan East

PostPosted: Jun 18, 2002 @ 2:52am
by brendan
don't like the temp idea, as files tend to hang around if program crashes.... :) Might have to look at the load code... or just say "stuff it", and supply files sepratly.... as files... ;) (only problem with that is makes it easy for others to hack around with program....

-Brendan