poco-libraries

C++ variable visable scopes and strems

为君一笑 提交于 2019-12-12 06:09:02
问题 I am newbie in C++ and can't understand some behavior. Have function below and in this case it works. bool Network::doRequest(HTTPRequest& request, string path, string content) { HTTPResponse response; istream* respStreamPtr; session->sendRequest(request); respStreamPtr = &session->receiveResponse(response); if (response.getStatus() == HTTPResponse::HTTP_UNAUTHORIZED) { credentials->authenticate(request, response); session->sendRequest(request); respStreamPtr = &session->receiveResponse

iOS: define and use C++ in Objective-C++

落花浮王杯 提交于 2019-12-12 04:59:24
问题 Can anyone tell me on how to define and use BinaryWriter and BinaryReader (from OpenFrameworks project on GitHub) C++ classes in iOS 5.x -> Objective-C++ ? what i do: AppDelegate.h #import <UIKit/UIKit.h> #import "Poco/BinaryWriter.h" @interface AppDelegate : UIResponder <UIApplicationDelegate>{ Poco::BinaryWriter *_myBinaryWriter; } @property (strong, nonatomic) UIWindow *window; @end AppDelegate.mm #import "AppDelegate.h" @implementation AppDelegate @synthesize window = _window; - (BOOL

Failure to compile “hello world” web server app with Poco

孤者浪人 提交于 2019-12-12 02:56:19
问题 When I search Google for "poco web server example", the very first link it offers me is this one. Now admittedly it has a zero star rating, and Google offers a more official example from Poco one step down the list. Nonetheless, the example is tantalisingly simple, so I tried to add it to an existing (MFC) project and compile it. When I do, I get these errors: [...]serverapplication.h(215): error C3646: '_serviceStatus': unknown override specifier [...]serverapplication.h(215): error C4430:

Poco ODBC and while SQL loop

我们两清 提交于 2019-12-11 13:11:25
问题 i'm working with mssql odbc C++ code : Session session("ODBC", connectionString); Statement select(session); select << sql; select.execute(); Poco::Data::RecordSet rs(select); bool more = rs.moveFirst(); std::size_t cols = rs.columnCount(); std::stringstream ss; ss << "<table>"; while (more) { ss << "<row>"; for (std::size_t col = 0; col < cols; ++col) { std::string cn = rs.columnName (col); ss << "<" << cn << ">"; ss << rs[col].convert<std::string>(); ss << "</" << cn << ">"; } ss << "</row>

Poco C++ libraries and Win32 GUI integration

末鹿安然 提交于 2019-12-11 03:46:58
问题 Has anyone ever used Poco C++ libraries in a Win32 GUI application? In the PocoFoundation library, many #undef inside the UnWindows.h header file, inhibit the use of important APIs ( as CreateWindows(), LoadLibrary(), and so on). All right, I can define the POCO_NO_UNWINDOWS flag, but other problems arise. Any suggestion is welcome. Sergio 回答1: Poco, as a portable library, is based on UTF-8 strings. Windows Unicode is UTF-16. For clarity purposes, it is recommended that all Windows API calls

why is std::condition_variable::notify_one blocking?

寵の児 提交于 2019-12-11 02:26:00
问题 For some reason the call signal.notify_one() blocks the current thread and doesn't return. I have never heard about this behavior and I don't know how to resolve it. { std::lock_guard<std::mutex> lock(_mutex); _exit = true; // _exit is a std::atomic<bool> } std::cout << "before" << std::endl; _signal.notify_one(); std::cout << "after" << std::endl; _thread.join(); I'm using Microsoft Visual C++ 2015 and the code above is called during destruction. I hope you can point me in the right

C++ POCO lib Linking Error when trying static linking VS9 express

邮差的信 提交于 2019-12-08 05:36:01
问题 Preview: Linking Error when trying static linking VS9 express I'm trying to compile a simple application in visual studio 2008 express based on Poco::Process . But I'm getting linking errors. Here is my simple code configured as console application: #include "Poco/Foundation.h" #include "Poco/Process.h" #include "Poco/Pipe.h" #include "Poco/PipeStream.h" using Poco::Process; using Poco::ProcessHandle; using Poco::Pipe; using Poco::PipeInputStream; using Poco::PipeOutputStream; int main(int

C++ POCO lib Linking Error when trying static linking VS9 express

别等时光非礼了梦想. 提交于 2019-12-08 00:22:25
Preview: Linking Error when trying static linking VS9 express I'm trying to compile a simple application in visual studio 2008 express based on Poco::Process . But I'm getting linking errors. Here is my simple code configured as console application: #include "Poco/Foundation.h" #include "Poco/Process.h" #include "Poco/Pipe.h" #include "Poco/PipeStream.h" using Poco::Process; using Poco::ProcessHandle; using Poco::Pipe; using Poco::PipeInputStream; using Poco::PipeOutputStream; int main(int argc, char** argv) { std::string cmd = "hostname"; std::vector<std::string> args; args.push_back("--help"

Trouble getting POCO HTTPSClientSession to send a request - certificate verify failed

為{幸葍}努か 提交于 2019-12-06 07:38:57
问题 I'm trying to use the POCO libraries to write a program that makes an HTTPS request to a server. For testing purposes, I'm connecting to a server which has a self-signed certificate, and I want to allow the client to connect anyway. To allow that to happen, I've attempted to install an InvalidCertificateHandler which is an instance of AcceptCertificateHandler - which I thought would accept the certificate even though it's not signed. Here's the code I'm using: try { Poco::SharedPtr<Poco::Net:

Load image from URL in C++

。_饼干妹妹 提交于 2019-12-06 05:13:10
I am using C++ and OpenCV and I'd like to load an image from password protected URL. I succeeded in loading image from URL using idea of this link which uses POCO library, but I do not know what should I do when I have to use username and password in order to access the URL. I'd say do what @StevenV said and try to encode the credentials in the URI. If that doesn't work or you don't want to use that method you have to use the POCO HTTPClientSession class instead. Something like this: URI uri(url); HTTPClientSession session(uri.getHost(), uri.getPort()); HTTPRequest req(HTTPRequest::HTTP_GET,