Home » U++ Library support » U++ MT-multithreading and servers » Skylark and GUI in one app - need some advices
Skylark and GUI in one app - need some advices [message #39771] |
Thu, 25 April 2013 13:17  |
Peter
Messages: 16 Registered: October 2012
|
Promising Member |
|
|
Hi.
I need to write a GUI app and have the ability to control it, alter its state or terminate it remotely from a separate website (sort of administration panel). Basically, I need to integrate GUI and Skylark in a single application in some clever and elegant way.
My first thought is to add an object of class derived from SkylarkApp as a field to my GUI class and start Skylark server in a separate thread while starting the whole application. It would be something like this:
App - my GUI class inherited from TopWindow
WebInterface - inherited from SkylarkApp
App class contains WebInterface object as one of its contents.
I start the whole app with App().Run() while WebInterface constructor contains the following line:
Thread().Run(THISBACK(WorkingThread));
This way I start both GUI and Web part of my application in separate threads. I hope you have a general idea of what I intend to do. Is that approach correct or potentially dangerous?
Meanwhile, I have two urgent problems to solve and need your help.
1. Is there any standard way to stop Skylark server from within a program? Basically, I need a clean way to stop the whole application without manually killing it by pressing CRTL+C. If such funtionality is currently not available, could you please add it to U++?
2. In a recent version of U++ (build 5990) on Ubuntu 12.04
an attempt to compile the following code (a single .cpp file) with g++ 4.6 and GUI MT SSE2 flags:
#include <CtrlLib/CtrlLib.h>
#include <Skylark/Skylark.h>
GUI_APP_MAIN
{
}
results in the following error:
"In file included from /home/piotr/MyApps/SkylarkTest/main.cpp:2:0:
/home/piotr/upp/uppsrc/Skylark/Skylark.h:86:15: error: expected unqualified-id before numeric constant"
For some reason if I change BadRequest to BadRequest1 in the following declaration in Skylark/Skylark.h
virtual void BadRequest(Http& http, const BadRequestExc& e);
the code compiles, but what's the real cause of this error? Looks like some bug in U++.
Regards
Piotr
[Updated on: Thu, 25 April 2013 14:34] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat May 10 00:21:02 CEST 2025
Total time taken to generate the page: 0.04246 seconds
|