Please post support and help requests here.
Posts: 5
Joined: 19 Jul 2012, 16:26


Postby Edsoon » 19 Jul 2012, 23:08

ServerApplication inherited from Application. Application has method const char* name () const :

const char* Application::name() const
return "Application";

Why this method returns constant "Application" ?
I thought that, this function must return the name of my application which set in config or other function.

Posts: 1268
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Poco::Application

Postby guenter » 22 Jul 2012, 03:27

name() is inherited from Poco::Util::Subsystem and is supposed the (static) name of the Subsystem. In case of Poco::Util::Application, this is "Application".
In order to get the name of the executable, use one of the app properties application.name or application.baseName:

Code: Select all

std::string::name = app.config().getString("application.name");

Return to “Support”

Who is online

Users browsing this forum: No registered users and 2 guests