Overview
Features
Download
Documentation
Community
Add-Ons & Services

POCO OSP like an Windows service.

A general discussion forum.

POCO OSP like an Windows service.

Postby retf » 19 May 2010, 14:46

-- POCO OSP like an Windows service.

Hi All,

I am using POCO OSP app like an Windows service and unix daemon, and I need get my .exe (working directory) directory, but when I try, i get this: C:\Windows\system32 (windows).

How i can get my exe dir???

I am in this class:

class EnterpriseManagerHandler: public HTTPRequestHandler

{ void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response)
{
}
...

Thanks
retf
 
Posts: 58
Joined: 19 May 2010, 14:32

Re: POCO OSP like an Windows service.

Postby guenter » 19 May 2010, 15:30

The working directory of a Windows service is the Windows system directory (usually C:\Windows\system32). To get the path to the directory containing the application exe, use the application.dir property from the Poco::Util::Application class:

Code: Select all
Poco::Util::Application& app = Poco::Util::Application::instance();
std::string applicationDir = app.config().getString("application.dir");
guenter
 
Posts: 1134
Joined: 11 Jul 2006, 16:27
Location: Austria


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron