How to applications-path  [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.
art-ganseforth
Experienced Solver
Experienced Solver
Posts: 92
Joined: Mon Sep 01, 2014 10:14 am

How to applications-path

Postby 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: 12822
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: How to applications-path  [SOLVED]

Postby 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
Experienced Solver
Experienced Solver
Posts: 92
Joined: Mon Sep 01, 2014 10:14 am

Re: How to applications-path

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

Thank you!

art-ganseforth
Experienced Solver
Experienced Solver
Posts: 92
Joined: Mon Sep 01, 2014 10:14 am

Re: How to applications-path

Postby 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]);
       ...
}


Return to “C++ Development”

Who is online

Users browsing this forum: Baidu [Spider] and 27 guests