PocketMatrix forums

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

Open file error

This is part of my code, where I'm trying to load font.png file from gamepack.epk. I get an error on line if (ecd->file->Open(filename)) .
In debugger window I see filename value as "\Program Files\Helloworld\gamepack.epk" char[512]. I dont really understand, where do edge reads file from? Why there is "Program Files" , when project folder is installed in C:\project\edge\samples. This is ppc2003-2005 application.


Data Abort: Thread=8da6e8e4 Proc=8c247550 'Helloworld.exe'
AKY=00004001 PC=0001309c RA=00000000 BVA=1e000010 FSR=00000407
Unhandled exception at 0x0001309c in Helloworld.exe: 0xC0000005: Access violation reading location 0x00000010.



Code:
char filename[MAX_EFILESTR];
unsigned char *filedata;
unsigned long filedatasize, fileid;
ClassEStd::StrCpy(filename, data->currentpath);
ClassEStd::StrCat(filename, "gamepack.epk");
if (ecd->file->Open(filename))



Please, could someone explain it to me?
Hi Ryumaster,

Edge reads files from the same path where the helloworld.exe application is. In your case it is installed on the Pocket PC inside "\Program Files\Helloworld\".

You need to copy the gamepack.epk file to your Pocket PC in this path.
Hi edge! Thanks for answering, now I understand where do 'Program Files' comes from.
I did copy "gamepack.epk" in this folder on ppc emulator, but it is still not working, and the error is the same. I tryed to check file with
Code:
(ecd->file->Exists(filename))
, but I got same error on this new line. Hmmmm. No doubt I'm doing something wrong.
Tnx, I've fixed it. No bother anymore.