[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

Re: Templates? (was Re: [XaraXtreme-dev] XCode - The main goal)



Ben,

At http://downloads.xara.com/opensource/doxygen/html/camdoc_8cpp-source.html
line 00325, the  OpenwxFSFile call fails and so both f and Filename
are NULL; This triggers the 'else' clause at line 00373.

I am not quite sure why the Open call fails. It might be a problem
with the filename, I have

2160 May 21 17:33 ./Templates/800 by 600 drawing.xar
4211 May 28 15:45 ./wxOil/xrc/800_by_600_drawing.xar

where the first figure is the file size. I have a feeling that the
code tries to open the version with spaces, but I am not certain that
it has the path correct. Does this ring any bells?

It should be opening the one without the spaces in (with the
underscores). Just checked it here. See what pFileName
contains when you go into the function (remember it's
a pointer to a UNICODE null terminated string). The
"Templates" version is only used by the installer
(which you aren't using). The difference in size is that
the Templates version is a xar file with compression on,
and for various tedious reasons the binary one is not
a compressed .xar file (though the whole resources are
zipped).

You should trace into that function and see where it gets to.
It should first go to:
  wxFSFile * CamResource::OpenwxFSFile(const TCHAR * pFileName )
in camresource.cpp. This will get the name of the correct file
to open from CamResource::GetResourceFilePath(). This latter
one will check if the file exists in an overloaded resource
directory (it shouldn't), and if not will assume it should
use the path to the built in zip file (beginning
memory:resources#zip: - It will then try and open it
through wxfilesystem.

So you could check that wxFileSystem::OpenFile is passed a
sensible path.

If you want to eliminate the zip loader, then try this
from the directory with XaraLX in.

(mkdir restest ; cd restest ; unzip ../wxOil/xrc/resources.xrs)
XaraLX -r restest

That should make a local copy of your resources zip file, and
get XaraLX to load resource from the files, not from the .zip
embedded in the executable. Note I am talking about Camelot
resources, not OS-X resources here.

Alex