PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

ID in EdgePack

Hi! Trying to Load PackFile with ID 0 always returns me an error. Why?

Code:
if (file.PackGetFileData(filedata, filedatasize, 0) == E_OK)


d:\game\sources\edgesouce\1\1\battle.h(55) : error C2668: 'ClassEFile::PackGetFileData' : ambiguous call to overloaded function
Hi Ryumaster,

This error message is related to a c++ issue. You need to cast 0 to the int datatype, like this:

Code:

if (file.PackGetFileData(filedata, filedatasize, (int)0) == E_OK)


It is caused by the fact that NULL and 0 are the same. It doesn't know which one of the following overloaded functions to call:
Code:

ERESULT PackGetFileData(unsigned char *&ptr;, unsigned long &datasize;, unsigned long id);
ERESULT PackGetFileData(unsigned char *&ptr;, unsigned long &datasize;, const char *filename);
ERESULT PackGetFileData(unsigned char *&ptr;, unsigned long &datasize;, const WCHAR *filename);
Very interesting. Thank you.