It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
i never actually used XML, someone can recommend me METHOD to create GUI configuration file for C\C++ application.
Recommend me framework or something, because i really dont know how what is best to use.
I code the application for Windows only, and i don't want to use framework that has dependencies on .NET.
Thanks in advance.
I think that you can use Glade to generate the XML for the GUI and use the GTK+ toolkit ...
By using GtkBuilder, Glade XML files can be used in numerous
programming languages including C, C++, C#, Vala, Java, Perl,
Python,and others.
Glade is Free Software released under the GNU GPL License.
... and it works well even on Windows ...
I would recommend looking at a product from the QT project called QT Quick that uses a configuration file (but it is not XML) to describe the user interface and JavaScript to handle actions and it interfaces with C++ code on the back end.
I don't think most GUIs use an XML file to describe the widgets/controls. But Mozilla has an XML based markup language that is used for creating GUIs called XUL (XML User Interface Language) . It may be possible to use it as a front end for C/C++ desktop code via some other technology called XPCOM/XPConnect.
I was at a presentation in which someone stated that using HTML5 (must be HTML-5) along with Javascript and a browser would replace traditional GUI toolkits as the front end for a C++ desktop application.
Thought, windows programmers may use internal(!) windows interfaces. Choose one from XMLDOM and xmllite.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
How might one create an application that communicates to an online website's message board, say www.espn.com's message boards that can retrieve posts, post stuff, and flag posts. How might somebody go about creating an application that does something like that? sockets?
I would like to create this in c++
This is actually more complicated than it sounds. Most message boards don't open up their API (usually to prevent spam), and if they do, you'll probably have to work with them to get the details.
The general idea is:
Open socket to their server
Send the appropriate data according to their API
Profit
If you want to hack it, you'll have to do some scraping/wireshark packet sniffing to figure out their API. There will probably be some cookies you'll have to read to get communication tokens and whatnot. It's possible, but it's a lot of work.
Some other websites (like Twitter and Google) open up their API and actually provide developer tools to interact with their data. I don't think a site like ESPN would be that open to hobbyist developers, so you'd probably have to sign some kind of agreement.
If you're really interested, read up on HTTP (here's a really simple beginning tutorial). Most APIs are built on the HTTP protocol, so you'll want to become very familiar with it. I'd recommend using something besides C++ though, since socket work can be a bit tedious. Try something like Python.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Is it possible to create a C++ application that can be run trough the browser? Is there any way to link C++ application with a database (that can be used by both Mac, Linux and Windows).
It's perfectly possible to do it, back in the day (when there was no PHP around), many web applications were written in C++. There is a standard called CGI that facilitates communication between your application and your web server. This tutorial shows hot to set it up for an Apache web server, using Perl as the target language. You should be able to write a C++ program that prints out the same text and test it.
Databases can be accessed using C++ using a variety of libraries, depending on your needs and database system.
While all of this is totally possible, I'd be interested why you would do such a thing in the days of sophisticated frameworks and languages that are far more suited to web applications than C++. I'd certainly not recommend it.
CGI or FastCGI for server side C++.
NaCl for client side C++.
Database connections with things like MySql Connector.
If by "through the browser" you mean a webapp, yes - you can write CGI applications in C++, as in most other languages. See the answers to this question.
wt is a toolkit that may make it easier for you if you come from a desktop background.
About the portable database layer, take a look at these two questions. If all you need is a database that works across platforms, but don't need to be able to switch database engines across platforms, SQLite may be the way to go.
If you mean by "run through the browser" to run native code in the browser the only way I know of to execute native code in the browser is Google's NaCl.
For server side C++ no special rules apply and it's very common. All normal rules for C++ application (including databases and linking) apply here.
Any scripting langauge can run COM. You can create COM objects in C++ that you can invoke serverside from php.
Is it possible to create a C++ application that can be run trough the browser?
I'm not sure what you mean by "run through the browser" (or, for that matter, "C++ application"). pmr has already mentioned Google NaCl as one option. If "C++ application" includes C++ plugins, then "sure, you can." You can compile C++ to Javascript. If you're talking about web sites or web services, I can say "yes, it's possible; I maintain a web service that uses C++ for the backend, and Amazon was once written in C++, do you have any particular question?"
It's possible to write a lot of things in a Turing complete language. That doesn't mean it's a good idea.
Is there any way to link C++ application with a database (that can be used by both Mac, Linux and Windows).
Again, I'm not sure what you mean by "link ... with a database." You certainly can interact with a database using things like ODBC, DTL, LDAP or MongoDB. You also can embed a database in your program, using things like SQLite, MySQL embedded, Firebird embedded, Berkeley DB, LevelDB, or whatever Microsoft's calling Microsoft Jet these days. Do you have a particular question?
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I am using windows xp and i want to develop my own plugin for google chrome using cpp like other plugins(flash or silverlite) because i have my own exe file so when particular page is open it find for plugins and if plugin is not installed on the system then it first ask to install that plugin form the server and if plugin is already installed then it will not ask and started service.
so anybody knows such type of example or any related tutorial then please tell me.
thank you in advance to all.
The NPAPI is not an easy API to use directly, IMO. However, there are frameworks that make the creation of plug-ins much easier. See:
FireBreath - "a framework that allows easy creation of powerful browser plugins"
nixysa - "A glue code generation framework for NPAPI plugins"
Checkout NPAPI or PPAPI.
NPAPI works in firefox and chrome.
PPAPI is chrome only and is experimental.
Chrome supports the NAPI interface for plugins. Check out:
https://en.wikipedia.org/wiki/NPAPI
https://developer.mozilla.org/en/Plugins
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I would like to write a simple text editor. I would like it to be GUI-based, and written using Qt.
Qt provides the class QTextEdit, which is a pretty fully-featured text editor (it supports ctrl+c, x , and z, text highlighting, and moving the cursor around left-right-top-down). I would like to write something similar, but I would like to implement all this functionality from scratch.
So my requirements are:
A simple window.
Be able to read text from a user, and output the prepared file to the screen.
The user must be able to access the text for editing.
I have taken a look at the source code to qtextedit.cpp from the official Qt site to get some idea of how this was implemented. Unfortunately I am not experienced enough to understand it (there are nearly 4000 lines of code, and many macros).
How might I make some progress with my project?
I think you are best off taking a look at some of the code here: http://kde-apps.org/index.php?xcontentmode=241
Take a look at the code, try coding something of your own, and realise that Qt requires one to know C++ fairly well. You will, at the very least, need to understand classes and pointers. If that feels manageable, then the best way is generally to try: you'll run into some problems, and then you can see how other people have solved that problem.
I think the most specific advice I can give is to write tests for everything that looks like it can reasonably be tested, that may save you some debugging time. Other than that, there's little more to say without example code and a more specific question.
This is a major job of work. If you want a decent editor, you are more or less forced to start with the Scintilla edit control, because it's simply the best (and it comes with a Lesser General Public Licence). But then you have to implement an editor on top of it. You don't really want to do this (trust me), so you have to use an existing open-source editor. The best of these is probably Notepad++, which has way more than 4000 lines of code. It comes with a General Public Licence, which is not compatible with the project I'm currently working on, so I ended up using the SciTE editor instead. I have implemented an interface for this which lets me embed it in a Qt application, and it works like a charm. In the next two or three months I hope to get this interface accepted by the SciTE community and incorporated into the official release. Meanwhile, if you are not bound by the licensing requirements, you might want to look at QScintilla.
In the Qt Demo application there is an MDI text editor that teaches a lot (http://doc.qt.nokia.com/latest/mainwindows-mdi.html).
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
What could be the best way of developing a C++ web application? The web app would be run on Apache HTTP server. How can you overcome challenges like sessions, persistence, context switching, multithreading etc with C++? How could one utilize C++ in best possible way to make it work like Servlets?
Take a look at Wt.
Wt (pronounced 'witty') is a C++
library and application server for
developing and deploying web
applications. It is not a 'framework',
which enforces a way of programming,
but a library.
The API is widget-centric, and
inspired by existing C++ Graphical
User Interface (GUI) APIs. To the
developer, it offers complete
abstraction of any web-specific
implementation details, including
event handling and graphics support.
It's not free for commercial use though.
Use C++ web framework like CppCMS if you like web-like
development, it is oriented for high performance and works with .
It provides:
FastCGI, SCGI and CGI interfaces.
Form processing and validation
HTML Templates system
Session management
Cache system
Transparent scale up to numerous servers.
You may give a try to Wt but it is much more
like writing GUI using browser rather then traditional web development tool.
I'm saying this as a C++ developer...
I would probably consider using Java instead. Since Java is much more commonly used for this, you'll find way more existing libraries to leverage. If you ever want to hire more people, you'll have an easier time finding web-app Java developers than web-app C++ developers.
If you insist using C++, check out:
http://rudeserver.com/
You can use Qt framework, Boost & Poco libraries to do web development in C++. Qt & Poco have DB support for various RDBMS. You may look into Axis C++ if you need to develop web services in C++. ClearSilver has C library to handle CGI and you can use C++ on top of it. Plenty of choices for you!
How can you overcome challenges like sessions, persistence, context switching, multithreading etc with C++?
The answer is what you'd expect it to be: pick libraries that handle issues when possible (multithreading) and implement libraries where necessary (generating a session key and storing it somewhere like a database).
Take a look at the Snorkel Embedded Web Server SDK. Its easy to use and produces the fastest web application solutions. http://sites.google.com/site/snorkelembedded
Try experimenting with the ffead-cpp framework, check out the home page for more information...