[ wxwindows-Bugs-1541037 ] wxFileSystem::FileNameToURL generates bad
filename on WinCE
SourceForge.net
noreply at sourceforge.net
Tue Aug 15 19:49:31 PDT 2006
Bugs item #1541037, was opened at 2006-08-16 02:49
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1541037&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: WinCE specific
Group: Platform specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Russellw G. Wells (rgwells)
Assigned to: Julian Smart (juliansmart)
Summary: wxFileSystem::FileNameToURL generates bad filename on WinCE
Initial Comment:
The wxFileSystem::FileNameToURL () generates an
incorrect file name on windows CE platforms.
I wrote a simple application that loads it's resources
from a xrc file. The application gets the directory of
the executable and then adds the name of the xrc file,
finaly it does an wxXmlResource load on this file. The
wxXmlResource Load call always fails on WINCE. Works
fine on Windows but fails on WinCE.
After digging some, the problem seems to lie in the
wxFileSystem::UrlToFileName method. The file name
passed in to wxXmlResource::Load gets translated first
to a file URL then back to a file name. When its
translated back from a file URL to a native file name,
the file name is getting generated wrong.
For example, say that the resource file on WINCE is
"\Program Files\test\resources.xrc".
This gets translated to the file URL "file://Program
Files/test/resources.xrc". This looks OK, but when when
it gets translated from this file URL back to a file
name, this is what I get:
"\Program Files:\test\resources.xrc"
That file name is obviouslt wrong, and so the resources
cannot be loaded.
Since windows CE does not have a volume and can only
have fully qualified file names, I patched the
wxFileSystem::URLToFileName code to force the string
that is passed to the wxFileName constructor to have
only a single leading '/' character. This patch solves
my problem loading resources and does not effect any
other platform.
See the attached file as a possible patch.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1541037&group_id=9863
More information about the wx-dev
mailing list