wxFileName::AssignCwd() and wxFileName::SetFullName() problems

Volker Bartheld dr_versaeg at freenet.de
Tue Dec 12 06:25:16 PST 2006


Hi Vadim!

Thanks for your patience.

>VB> Actually, I was trying to tell the wxFileName object that it should
>VB> consider a relative path it might have been constructed with to be
>VB> relative to a directory I specify via some kind of member function -
>VB> without having to globally (re)set the current working directory because
>VB> that might influence the rest of the application.

> You want to use Normalize() with non empty second parameter.

What happens in case wxFileName has been constructed using an absolute
path? Hopefully, it will just return false and don't touch anything.

>wxFilename::AssignCwd() calls (static) ::wxSetWorkingDirectory()
>I didn't say it wasn't called, it is. But it is then called again to
>restore the old working directory as a quick look at the sources shows.

Thread safety is not an issue with that approach?

>VB> I'm aware of wxStandardPaths. Actually I would need a portable
>VB> equivalent of Win32's ::GetModuleFileName(NULL, ...)

> Well, this is what wxStandardPaths is (and more).

... in 2.8.0, such as wxStandardPaths::GetExecutablePath(). ;-)
Unfortunately, we still have 2.7.0 on our buildserver, so I'll have to
wait a while until I'm able to ditch the dreaded
GetDataFolderOfApplication() but will already encapsulate the new code
in #if(wxCHECK_VERSION(2, 8, 0)).

Cheers,
Volker
__
Mail replies to/an V B A R T H E L D at G M X dot D E






More information about the wx-users mailing list