how to find if a .exe is running in c++
how do you find if a exe is running (By name, i.e program.exe). Edit: Sorry im using it on windows ...
how do you find if a exe is running (By name, i.e program.exe). Edit: Sorry im using it on windows ...
Hi, I'm designing a cross platform (Windows/Linux/OS X) application, something like a digital audio workstation. I'd like to create a software where users have a fully featured sequencer (multiple tracks with automation) and where it is possible to create instruments using a visual language (as Pure Data/Max MSP). Ehm... I know that I'...
This question has been asked before and there have been windows-specific answers but no satisfactory gcc answer. I can use set_terminate() to set a function that will be called (in place of terminate()) when an unhandled exception is thrown. I know how to use the backtrace library to generate a stack trace from a given point in the progr...
Hi, this question may seem a bit too specific, but I figure I'd give it a shot here since I've found some great programming answers here in the past. I am modifying the open-source program TinyCad for a project I'm working on. I've visited the TinyCad message board and posted, but I didn't get the answer I'm looking for. I'm having trou...
I have a data structure that stores ... well, data. Now, I need to access various pieces of data in slightly different manner, so I'm essentially building an in-memory index. But I'm wondering: should the index hold pointers or copies? To elaborate, say I have class Widget { // Ways to access the list of gears... private: std::...
This is weird. I created a vector just fine in one class but can't create it in another class. He's a representation of what I have: main.h #include <Windows.h> #include <ShellAPI.h> #include <vector> #include <string> #include <iostream> #include "taco.h" class MyClass { public: int someint; vector<int> myOrder; }; taco.h...
My 15 year old little brother is starting out programming, and he wrote a neat little program that outputs all combination of letters and numbers that are six digits or less. His code was a sextuple-nested for loop that updated the elements of a six level char array. It looked bad, but was certainly fast! I showed him how to do a simp...
Hello, I have a project written in C++ and I'm looking to write a Java GUI as an interface to it. The choice of Java is fixed so I'd need to learn how to be able to call the C++ code from Java. Rewriting the C++ code is not an option. I'd like input on: What tools can I use to achieve this wrapping. How much of the C++ code would I h...
Consider the following class structure: class Filter { virtual void filter() = 0; virtual ~Filter() { } }; class FilterChain : public Filter { FilterChain(collection<Filter*> filters) { // copies "filters" to some internal list // (the pointers are copied, not the filters themselves) } ~Filter...
I will be storing terabytes of information, before indexes, and after compression methods. Should I code up a Binary Tree Database by hand using sort files etc, or use something like MongoDB or even something like MySQL? I am worried about (space) cost per record with things like MySQL and other DB's that are around. I also know that ...
I've got this (incorrect) sample code for getting a value out of stringstream and storing it in a byte-sized variable (it needs to be in a single byte var, not an int): #include <iostream> #include <sstream> using namespace std; int main(int argc, char** argv) { stringstream ss( "1" ); unsigned char c; ss >> c; cout ...
Hey guys, maybe you can help me get this right. I have a class that is used to draw a circle, but the compiler sends me this message: In file included from ./Includes.h:19, from ./Circle.h:8, from ./Circle.cpp:5: ./GameApp.h:24: error: ISO C++ forbids declaration of 'Circle' with no type ./GameApp.h:24:...
Very simple codes located in the same file 'foo.h': class Xface { public: uint32_t m_tick; Xface(uint32_t tk) { m_tick=tk; } } std::map<uint32_t, Xface*> m; Xface* tmp; tmp = new Xface(100); **//Error** m[1] = tmp; **//Error** tmp = new Xface(200); **//Error** m[2] = tmp; **//Error** The error is error...
Dear reader, I'm working on a (c++, opengl) project where I need to have lots of particles which influence eachother, if I'm correct this is called a nbody problem. Does someone knows what solutions there are for algorithms like this. I know the barnes hut algorithm and maybe I can peek around openCL, though I'm not just wondering if y...
The compiler defined constructor is empty and does not initialize the member variables. Then why does the compiler create one? Also what is the difference if any between a compiler defined constructor and an user defined empty constructor? ...
Consider the following situation: class MyFoo { public: MyFoo(); ~MyFoo(); void doSomething(void); private: unsigned short things[10]; }; class MyBar { public: MyBar(unsigned short* globalThings); ~MyBar(); void doSomething(void); private: unsigned short* things; }; MyFoo::MyFoo() { int i; for (i=0;i<10;i++) this...
Hi I've been doing some research about matrix inversion (linear algebra) and I wanned to use c++ template programming for the algorithm , what i found out that there are number of methods like: Gauss-Jordan Elimination or LU Decomposition and I found the function LU_factorize (c++ boost library) I want to know if there were other metho...
here is code #include <iostream> #include <fstream> #include <cstring> using namespace std; int main() { ofstream out("test", ios::out | ios::binary); if(!out) { cout << "Cannot open output file.\n"; return 1; } double num = 100.45; char str[] = "www.java2s.com"; out.write((char *) &num, sizeof(double)); ou...
class FinalList { Location List[20]; int MaxSize; int Size; public: FinalList() { MaxSize = 20; } void RunIt(); void Show(); void Mean(); void Menu(); }; void FinalList::Mean() { int K; double Total; double Average; for(K=0 ; K < Size ; K++) Total += List[K].Va...
I have following code: #include <iostream> using namespace std; template<class T> T max(T *data,int len){ int i; T Max=data[0]; for (int i=1;i<len;i++){ if (data[i]>max){ Max=data[i]; } } return Max; } int mai(){ int i[]={12,34,10,9,56,78,30}; int len=sizeof(i)/sizeof(i[0]); ...