How to applications-path Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
art-ganseforth
Earned some good credits
Earned some good credits
Posts: 114
Joined: Mon Sep 01, 2014 10:14 am

How to applications-path

Post by art-ganseforth » Mon May 28, 2018 3:00 pm

Hello,

a quiet simple thing, but i don't know how to search the dcoumentation for this: I need the name of the folder, where my application is started from. How to get it??

Best,
Frank

User avatar
doublemax
Moderator
Moderator
Posts: 13430
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: How to applications-path

Post by doublemax » Mon May 28, 2018 3:35 pm

http://docs.wxwidgets.org/trunk/classwx ... 0cfbb35c6b
Gives you the complete path for the executable, you can extract the path from there.

Make sure to use the global instance with wxStandardPaths::Get(), don't create a new instance of it.
Use the source, Luke!

art-ganseforth
Earned some good credits
Earned some good credits
Posts: 114
Joined: Mon Sep 01, 2014 10:14 am

Re: How to applications-path

Post by art-ganseforth » Mon May 28, 2018 4:11 pm

Thank you!

art-ganseforth
Earned some good credits
Earned some good credits
Posts: 114
Joined: Mon Sep 01, 2014 10:14 am

Re: How to applications-path

Post by art-ganseforth » Tue Jun 05, 2018 1:29 pm

I Searched some very old codes because i remembered that there was another solution. There i found this:

Code: Select all

IMPLEMENT_APP(Projekt1DlgApp)

bool Projekt1DlgApp::OnInit() {
	wxString filename = wxString(argv[0]);
       ...
}

Post Reply