PocketMatrix forums

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

CGapiVFS on win32 system

I'm currently loading a VFS that includes 3 images - and it says it's loading ok. In debug mode the details that I can get from the CGapiVFS object shows the correct bytes read( m_dwSize ) but the Number of Open Files reads zero ( m_dwOpenFiles ). When I try to create a surface with the VFS it fails. I've tried both the Buffer read and File stream and both say they can't find the file ( GDERR_FILENOTFOUND ). I've attempted to create folders in which the images live but nothing seems to help. I've even tried using absolute path in which I created the VFS file - that is how desperate I am. ;)

I've looked at the Palm example tileDemo but from the looks of it I'm doing everything ok. Is there any known bugs on the VFS for a Win32 system? i did a search on the forum and couldn't find a thing except for a special RC1 post which didn't give any real help. Thanks a bunch everybody.
Can you please post the search paths of your three images. Do you use "/" or "\"?
I figured I should of done it in the beginning. But here we go..

Code:

//Load the VFS
char path[_MAX_PATH];
int result = m_pFileSystem->CreateVFS( GetAbsolutePath( path, _MAX_PATH, "firsttry.vfs" ) );

//This returns S_OK.
//later on I call..


CGapiFileStream *file = new CGapiFileStream();
int resultFile = file->Open( m_pFileSystem, "test.png" );
//This returns GDERR_FILENOTFOUND - I only do this for testing
//So I then try:

TCHAR *name = "test.png";
CGapiFileBuffer *buffer = new CGapiFileBuffer();
int bufferResult = buffer->Open( m_pFileSystem, name );
//This returns not found too and again I'm only doing this for testing
//So next I try to create the surface

int result = m_iShips.CreateSurface( 0, m_pFileSystem, name );
//This of course fails as well.



I've even tried putting in multiple different path solutions, for example using the .\ and the ./ and even the absolute path. I’ve even created folders and placed the images in there and it never seems to find them. The biggest difference I can see compared to the example program is that I'm loading the file externally. Thanks again for looking at this.[/code]
Hi again,

Please read through the online documentation to GapiVFS at:
http://www.develant.com/docs/gapidraw/3 ... -frame.htm

As for paths, the documentation says:
"The file path must start with a slash, '/', otherwise CGapiFileBuffer::Open will return GDERR_FILENOTFOUND. Relative search paths within the virtual file system is not allowed. Also, use '/' to specify folders, such as '/myrootfolder/mysubfolder/myfile.bmp'."

Please try "/test.png" (as it is shown in the Palm samples) and post your results here...
Sorry about that. I had actually read that and thought I had tried it. Anyways it's working like a champ now.

thanks
I'm glad to hear that!

There is one folder matching issue however in the current release. If you have two folders, for example: "/folder/", and another folder "/foldertwo/", and try to load a file from "/foldertwo/" it will fail and give file not found. The issue is the string comparison that does not verify if the search path and the folders stored in the VFS are of equal size. This issue however has been corrected and will be released in the 3.01c update due out shortly.