In the past, when I've worked on long-running C++ daemons I've had to deal with heap fragmentation issues. Tricks like keeping a pool of my large allocations were necessary to keep from running out of contiguous heap space.
Is this still an issue with a 64 bit address space? Perf is not a concern for me, so I would prefer to simplif...
We've been trying to hunt down some heap corruption issues in our multi-threaded C++ apps. As one technique, we tried add -lmcheck to the libraries line of the application. This is causing the app to crash out with apparent heap corruption in relatively short order.
Our app does use both malloc/free and new/delete (as appropriate).
On...
I know it makes little difference to a project but, assuming you use #defined header guards for your C++ code, what format do you use? e.g. assuming a header called foo.hpp:
#ifndef __FOO_HPP__
...
#ifndef INCLUDED_FOO_HPP
...
#ifndef SOME_OTHER_FORMAT
I'm sold on the idea of upper-case #defines but cannot settle on a format for th...
I have a dll that was written in c++, I need to use this dll in my c# code. After searching I found that using P/Invoke would give me access to the function I need, but these functions are defined with in a class and use non-static private member variables. So I need to be able to create an instance of this class to properly use the func...
I'm trying to find the best solution for nonblocking IO via stdin/stdout with the following characteristics:
As long as there is enough data, read in n-sized chunks.
If there's not enough data, read in a partial chunk.
If there is no data available, block until there is some (even though it may be smaller than n).
The goal is to allo...
Our app encrypts a value using RC2 in C++ code and I wrote a decryption routine in .NET
The problem is that it works fine on our dev server, which is Windows 2003 but fails on the Windows 2000 one. It's running the same code and I checked everything else and it seems there are differences in the way the 2 encrypt.
Has anyone had any ...
My C++ framework has Buttons. A Button derives from Control. So a function accepting a Control can take a Button as its argument. So far so good.
I also have List<T>. However, List<Button> doesn't derive from List<Control>, which means a function accepting a list of Controls can't take a list of Buttons as its argument. This is unfortun...
Hi
I'm using the QMdiArea in qt4.4.
What I'm doing:
If a new project is created, I add a number of subwindows to a QMdiArea.
And I'd like to disallow the user to close a subwindow during the runtime.
The subwindows should be closed, if the hole application is closed or if a new project is created.
As I have seen in the qt-documentaion,...
I'm using two commercial libraries that are produced by the same vendor, called VendorLibA and VendorLibB. The libraries are distributed as many DLLs that depend on the compiler version (e.g. VC7, VC8). Both libraries depend on a another library, produced by this vendor, called VendorLibUtils and contained in one DLL.
The problem: Vendo...
When coding, what is a good rule of thumb to keep in mind with respect to performance? There are endless ways to optimize for a specific platform and compiler, but I'm looking for answers that apply equally well (or almost) across compilers and platforms.
...
Is there some way to detect file handle leaks at program termination?
In particular I would like to make sure that all of my handles that get created are being freed in code.
For example, I may have a CreateFile() somewhere, and at program termination I want to detect and ensure that all of them are closed.
...
I'm trying to find a good way to detect a loss of connection.
My adapter is implemented as a Fix::Application based on one of the examples. It uses a socket initiator to connect to the fix gateway.
When I unplug the internet it takes about 30 seconds for the Fix::Application's onLogout method to be fired. It seems like some underlyin...
Is there a c++ equivalent of java's
try {
...
}
catch (Throwable t) {
...
}
I am trying to debug java/jni code that calls native windows functions and the virtual machine keeps crashing. The native code appears fine in unit testing and only seems to crash when called through jni. A generic exception catching mechanism would ...
There are a few things that I almost always do when I put a class together in C++.
1) Virtual Destructor
2) Copy constructor and assignment operator (I either implement them in terms of a private function called Copy(), or declare them private and thus explicitly disallow the compiler to auto generate them).
What things do you find are...
Having recently introduced an overload of a method the application started to fail.
Finally tracking it down, the new method is being called where I did not expect it to be.
We had
setValue( const std::wstring& name, const std::wstring& value );
std::wstring avalue( func() );
setValue( L"string", avalue );
std::wstring bvalue( func2()...
I'm looking at doing some work (for fun) in a compiled language to run some simple tests and benchmarks against php.
Basically I'd like to see what other people use for C++ CGI programming. (Including backend database, like mysql++ or something else)
...
Possible Duplicate:
Which Programming Language Should I Learn?
So I recently just finished a year of Java in my Computer Science class, and want to further pursue programming. I was not much thrilled about Java, I liked the OOP part but disliked its execution speed.
I was thinking C++ but I keep hearing people complain (?) ab...
I have a medium sized application written in c++ using QT. I wanted to profile things to see where my least performant code was so I compiled everything with -pg.
However, my application makes use of a lot of plugins using the QTPlugin mechanism (boils down to a dlopen and a dlsym of a instance object per plugin). I've noticed that gpro...
How do Window's programmers profile their native C++ code?
On Unix/Linux you have gprof [thanks Evan] & valgrind (I personally used this one, although it's not a real profiler), and recently I'm on Mac and Solaris, which means I moved to dTrace. Now when I've had the need to profile on Windows in the past, like at my previous job, I used...
Does stl in c++ have tree data structure.If not any c++ implementation for tree structure?
http://stackoverflow.com/questions/205945
...