Quote:
@JCL: can you confirm 1.) that the method "Load" is intended for reading from a buffer


No hurry, I confirm this by myself. It is also more robust, because if I open a file which is not in the work dir, the reader confirms that the file is opened (sic!), but I get a NULL-header... weird.

Here is the pattern:

Code:
// load file into buffer
long buffersize = 0;
void* buffer = file_load(filename, NULL, &buffersize);

HMP7R hmp;
if (hmp.Load((unsigned char*)buffer, buffersize))
{
	// get header
	const HMP5_HEADER* header = NULL;
	bool bHeader = hmp.Head(&header);

	if (bHeader && (header != NULL))
	{
		// do some magic!
	}

	hmp.Close(); // close file
}

// free the buffer
file_load(NULL, buffer, NULL);



So, @JCL: Do you think you can add saving to a buffer or so? smile please!

Last edited by HeelX; 01/14/12 22:57.