Managing programs that run in multiple console windows? - c++

I have a script that starts 7 or 8 different c++ server modules that all open in console windows on a windows machine. I've been looking for a way to run all of these in a single, tabbed window. I've tried a few programs out there, but they are mostly cmd.exe replacements and aren't really designed for running programs like this. Has anyone else run into this and found a good solution?

Try out Console2:

Related

How to use Windows C++ AttatchConsole with Cygwin terminals

I have a c++ windows application that runs via a GUI. I made a CLI for it to automate some things and this works fine if I use
AllocConsole();
or even
AttachConsole(PID);
as long as it is attaching to a windows CMD terminal.
I want to attach to a Cygwin terminal so I can use Expect to automate some things, but attach console always fails here and results in errors when trying to write to it.
Does anyone know how to make a windows application attach to a Cygwin terminal like this?
Not all cygwin terminals use the windows console. If you are not using a windows console then AttachConsole simply will not help you.
In particular a mintty.exe terminal will not work with AttachConsole because it is not a windows console.

How to start program before login in windows in c++? [duplicate]

I've written a console program that "does stuff" - mainly using boost. How do I convert it to a Windows Service?
What should I know about Windows Services beforehand?
There's a good example on how to set up a minimal service on MSDN. See the parts about writing the main function, entry point and also the example code.
Once you've got a windows service built and running, you'll discover the next major gotcha: it's a pain to debug. There's no terminal (and hence no stdout/stderr) and as soon as you try to run the executable it actually launches the service then returns to you.
One trick I've found very useful is to add a -foreground option to your app so that if you run with that flag then it bypasses the service starter code and instead runs like a regular console app, which makes it vastly easier to debug. In VS.Net set up the debugging options to invoke with that flag.
There's a really good example on msdn here
It's a boiler plate C++ service project that has self install/uninstall functionality and logs service start and stop events to the windows event log. It can be stopped and started through the services app (snapin) like other services. You may want to initially give it LocalSystem rights to see it working , as on xp at least it doesn't have enough rights to start with the project provided rights of LocalService. The Visual Studio 2008 project otherwise runs out of the box despite the downloaded instructions implying otherwise.
A bit late but I hope this helps someone else.
You might be able to 'wrap it' using this tool from CodeProject:
http://www.codeproject.com/KB/system/xyntservice.aspx
Worth a look.
The simplest solution might be to create a new Windows Service project in Visual Studio and copy across your code to the new project.
If you refactor your code so that you've split the UI (in this case the console) from the logic you could create a library that does the work and then call that from both the Console project and the Service Project.
You can configure an application to run as a service by using the Srvany tool, which is a part of the Windows Server 2003 Resource Kit Tools.
Srvany allows only one service at same time. So I write my srvany (sFany) to make nginx and php-cgi run as windows service together. Here is the source https://github.com/stxh/sFany

Multi-platform way to check if a process is running via the process name

I'm making a program that will hopefully run on Windows, AppleOS, and GNU/Linux. For the program I need to check if "steamchildmonitor" is running. I know I could do this using ppgrep on linux. But I would rather have one piece of code that runs on all systems. Is this possible, if not what would I use to check if it is running on Windows (I believe the AppleOS implementation would be the same as the linux one). Thanks in advance!

embedding .exe applications on a QT form

I wanted to know if its possible to embed other .exe applications on a QT form.
Say i have an app called foo.exe. Now I want to lauch foo.exe through my application. I know I could do that using QProcess::startDetached() however I would like that program to run within my form.Is that possible ?
Believe what you want is a kind of "EMBED", there seems to be something done, but I can direct you to a few ways:
Cygwin
In X Window System we have o "X-Embed"
For Windows exists Cygwin/X (apparently to run "multi-threaded" in "google chrome" uses cygwin).
QT X11 Systems: http://qt-project.org/doc/qt-4.8/qvfb.html
Nice example: http://arstechnica.com/information-technology/2009/03/experimental-process-per-tab-browser-created-with-qt-xembed/ (outdated)
ActiveX
You can create Activex Controls, see example: http://qt-project.org/doc/qt-4.8/activeqt-server.html
In two suggestions that you spent the programs you want to add to your main program should be created by you, in other words, programs that are not compiled with "Cygwin" or is not an "ActiveX" (QT you can add controls ActiveX, such as Internet Explorer or MSExcel).
Believe both examples programs work as "servers" and its main program as a "client", in other words, other processes need not necessarily one graphical interface, I believe the main software is who works the GUI part.
For this reason the programs should be "embedded" created with the purpose of "embedding"
Alternative solution (DotNet and user32.dll)
See article:
http://www.codeproject.com/Articles/9123/Hosting-EXE-Applications-in-a-WinForm-project

Netbeans MPI c++ how to start?

Hello everyone I just staring developing c++ under netbeans/ubuntu(x64) and now I am staring with MPI. How can I compile, test,run mpi applications under. Thanks a lot.
Till now, I've found only this IDE for MPI on Linux: Geany (a tutorial is here.)
But I keep searching...
If anyone find better IDE, please share under this question...
There is an Eclipse plug-in for parallel programming, including MPI: http://www.eclipse.org/ptp/
To build, change the C++ compiler in NetBeans's C/C++ options to be /path/to/mpicc.
As for running, MPI applications are usually invoked with mpirun. This is done either via the command line (on your PC) or via a batch description file (on a cluster with OpenPBS, LoadLeveler, or similar scheduler). I've never tried to run MPI via an IDE, though NetBeans does have an option for the debugger command, so you might be able to try that and see what happens.