c++

Is it possible for a process to catch an unhandled exception of another process on windows?

Is it possible for a process to catch an unhandled exception of another process on the system? If possible, under which circumstances is it possible? Is it for instance possible if the second process is not started by the first? I am mainly looking for an answer regarding native c++. ...

How to set timeout in mysql c++ connector

I am using c++ connector to connect to MySQL server. When server is offline or in sleep,the statement execute method takes a while to detect the connection problem. Is there a method or variable to control the waiting timeout period in client? Regards Devara Gudda ...

CreateProcess(...) does not invoke OnLoad event

Hi folks, I am currently working on a C++ programm which calls another C# programm I have code-level access to. However when I call the program using CreateProcess(0, temp2, 0, 0, false, 0, 0, 0, &si, &pi) where temp2 contains the executable including command line parameters the C# program starts but the OnLoad event of the MDIForm (= m...

C++ function calling from C# application. Attempted to read or write protected memory

The problem below is ralated to my previous question http://stackoverflow.com/questions/2384932/converting-static-link-library-to-dynamic-dll My first step was to develop a dll, that was done. (Thanks John Knoeller prakash. Your input was very helpful) Now when i call the function in the dll from my c# application i get the error "A...

Why autoconf isn't detecting boost properly?

I am using autoconf to detect boost libraries, with the support of the autoconf-archive macros and they work fine with system-wide boost libraries, but fail if I manually compile boost in my home directory: sb@stephane:~/devel/spectra2$ ./configure --with-boost=/home/sb/local/ checking for a BSD-compatible install... /usr/bin/install -c...

c++ transform with pair go in Segmentation fault

This code works: class Test { public: Test(string name) : _name(name) {}; bool operator()() { cout << "hello " << _name << endl; return true; } string name() { return _name; } private: string _name; }; pair<string, bool> inline execute_test(Test* t) { return pair<string, bool>(t->name(), (*t)()); } int main() { vector<Test...

Under what circumstances must I provide, assignment operator, copy constructor and destructor for my C++ class?

Say I've got a class where the sole constituent is something like a std::string or std::vector - do I need to provide copy constructors / destructors / assignment operator? ...

Compiling a C/C++ application against OpenGL and Xm in OSX

Hi, I am rather new to Mac OSX. I am trying to get an old code compiled in OSX Leopard, which uses OpenGL and XM. The headers are like: #include <malloc.h> #include <X11/Intrinsic.h> #include <X11/StringDefs.h> #include <X11/keysym.h> #include <Xm/MainW.h> #include <Xm/RowColumn.h> #include <Xm/PushB.h> #include <Xm/PushBG.h> #in...

Getting redirect information with C# and C++

Hi all. What am I doing wrong? I'm trying to get redirect information from a server that I use for authenticating a user. This works good with my C# code but I cannot make my C++ code working. So here's the working C# code: string postData = @"username=myUsername&serviceID=someServiceId&password=somePassword"; byte[] postBytes = Encodin...

How to remove smart pointers from a cache when there are no more references?

Hi, I've been trying to use smart pointers to upgrade an existing app, and I'm trying to overcome a puzzle. In my app I have a cache of objects, for example lets call them books. Now this cache of books are requested by ID and if they're in the cache they are returned, if not the object is requested from an external system (slow operati...

Error yaml-cpp compile in RAD Studio 2010

I can't compile yaml-cpp in RAD Studio 2010. I have error in nodeutil.h template <typename T, typename U> struct is_same_type { enum { value = false }; }; template <typename T> struct is_same_type<T, T> { enum { value = true }; }; template <typename T, bool check> struct is_index_type_with_check { enum { value = false }; }; template ...

Help with using Xcode

So, I'm using Xcode to program with C++. I want to access the C++ tool but I'm having this problem. This is what it looks like when opening a new project. Only for me, I don't have the 'Command Line Utility' option at the end. How can I get the 'Command Line Utility' option to be available. I need it to access the C++ tool. Please...

c++: getting ascii value of a wide char

Hi all! let's say i have a char array like "äa". is there a way to get the ascii value (e.g 228) of the first char, which is a multibyte? even if i cast my array to a wchar_t * array, i'm not able to get the ascii value of "ä", because its 2 bytes long. is there a way to do this, im trying for 2 days now :( i'm using gcc. thanks! ...

Difference between float and double

I know, i've read about the difference between double precision and single precision etc. But they should give the same results on most cases right ? I was solving a problem on a programming contest and there were calculations with floating point numbers that were not really big so i decided to use float instead of double, and i checked...

Retrieve time from the internet (bypassing PC clock)?

For my MFC/C++ unmanaged time-limited software needs, I'd like to get a GMT/UTC time-stamp from the internet (instead of relying on the PC clock time that can be easily changed). I already though about parsing the line "Current UTC"... line from http://www.timeanddate.com/worldclock/ (I think port 80 is more likely to be open than other...

How can I stop the class view add member function wizard from adding (void) to argumentless functions?

The post http://stackoverflow.com/questions/1593349/vs2008-win32-project-defaults-remove-default-precompiled-headers outlines how you can edit the wizards to remove the use of precompiled headers. Can I do something similar to stop the add member classview wizard from adding (void) to argumentless functions? ...

Where should you put global constants in a C++ program?

Where would you put global constants in a C++ application? For example would you put them in a class? In a struct? ...

C++ IDE for linux (ubuntu 7.1)

Hello, I wanna get a complete C++ IDE for linux, specifically ubuntu 7.1, but I want a kind of link where I could download all the files and packets at once, because I have to install it on a remote pc that is far from one Internet connection. I don't need and strong IDE because it is for teach basics of C++. Could you please help me??? ...

Open Source FIX Client Simulator

I want test a FIX gateway for our company and was wondering if anything in opensource already exists that I can use or perhaps leverage to complete this task. I am currently looking at QuickFix but I am not sure if it has a client that can be use against any standard FIX gateway. Also links to any learning material that exist on this...

Help understanding part of this generated assembly code

Can anyone explain to me the assembly generated by GCC of the following C++ codes? espeically, the meaning of setg and test in the codes. thx! .cpp codes: 1 /*for loop*/ 2 int main() 3 { 4 int floop_id; 5 for(floop_id=100;floop_id>=1;floop_id--) 6 {} 7 return 0; 8 } assembly codes: 3 p...