c++

Good book for learning the C++ standard template library?

I'm looking for a good tutorial book on the C++ Standard Template Library. I don't want a reference, there are plenty of them online, but rather a book that will lead me through using the various parts of the STL and give some insight into why it is the way it is. Does anybody know of such a book? ...

Thread pool for executing arbitrary tasks with different priorities

I'm trying to come up with a design for a thread pool with a lot of design requirements for my job. This is a real problem for working software, and it's a difficult task. I have a working implementation but I'd like to throw this out to SO and see what interesting ideas people can come up with, so that I can compare to my implementatio...

Best full text search alternative to ms sql, c++ solution

What is the best full text search alternative to ms sql? (which works with ms sql) I'm looking for something similar to Lucene and Lucene.NET but without the .NET and Java requirements. I would also like to find a solution that is usable in commercial applications. ...

How to do a simple mail merge in OpenOffice

I need to do a simple mail merge in OpenOffice using C++, VBScript, VB.Net or C# via OLE or native API. Are there any good examples available? ...

How to take screenshot in Mac OS X using Cocoa or C++

How to take screenshot programmically of desktop area in Mac OS X ? ...

Tool to check Doxygen markup is up to date

I'm using Doxygen to generate documentation for my (C++) code, and am wondering if there is a tool that would give me a list of all functions/methods for which the current Doxygen markup doesn't describe all the arguments (or describes too many)? Maybe this is already included in Doxygen? (in which case I couldn't find the feature !) ...

Very simple C++ DLL that can be called from .net

Hi, I'm trying to call a 3rd party vendor's C DLL from vb.net 2005 and am getting P/Invoke errors. I'm successfully calling other methods but have hit a bottle-neck on one of the more complex. The structures involved are horrendous and in an attempt to simplify the troubleshooting I'd like to create a C++ DLL to replicate the problem....

Do C++ logging frameworks sacrifice reusability?

In C++, there isn't a de-facto standard logging tool. In my experience, shops roll their own. This creates a bit of a problem, however, when trying to create reusable software components. If everything in your system depends on the logging component, this makes the software less reusable, basically forcing any downstream projects to t...

Visual C++: How large is a DWORD with 32- and 64-bit code?

In Visual C++ a DWORD is just an unsigned long that is machine, platform, and SDK dependent. However, since DWORD is a double word (that is 2 * 16), is a DWORD still 32-bit on 64-bit architectures? ...

Calling DLL functions from VB6.

I've got a Windows DLL that I wrote, written in C/C++ (all exported functions are 'C'). The DLL works fine for me in VC++. I've given the DLL to another company who do all their development in VB. They seem to be having a problem linking to the functions. I haven't used VB in ten years and I don't even have it installed. What could be th...

How to get intellisense to reliably work in Visual Studio 2008

Hi, does anyone know how to get intellisense to work reliably when working in C/C++ projects? It seems to work for about 1 in 10 files. Visual Studio 2005 seems to be a lot better than 2008. Edit: Whilst not necessarily a solution, the work-around provided here: http://stackoverflow.com/questions/39474/how-to-get-intellisense-to-relia...

Error handling / error logging in C++ for library/app combo

I've encountered the following problem pattern frequently over the years: I'm writing complex code for a package comprised of a standalone application and also a library version of the core that people can use from inside other apps. Both our own app and presumably ones that users create with the core library are likely to be run both ...

How do I remove an item from a stl vector with a certain value?

I was looking at the API documentation for stl vector, and noticed there was no method on the vector class that allowed the removal of an element with a certain value. This seems like a common operation, and it seems odd that there's no built in way to do this. ...

How would you implement Erlang-like send and receive in C++?

Actually, this question seems to have two parts: How to implement pattern matching? How to implement send and receive (i.e. the Actor model)? For the pattern matching part, I've been looking into various projects like App and Prop. These look pretty nice, but couldn't get them to work on a recent version (4.x) of g++. The Felix lan...

Can I have polymorphic containers with value semantics in C++?

As a general rule, I prefer using value rather than pointer semantics in C++ (ie using vector<Class> instead of vector<Class*>). Usually the slight loss in performance is more than made up for by not having to remember to delete dynamically allocated objects. Unfortunately, value collections don't work when you want to store a variety o...

How to wrap a function with variable length arguments?

I am looking to do this in C/C++. I came across Variable Length Arguments but this suggests a solution with Python & C using libffi. Now, if i want to wrap printf function with myprintf i do like below: void myprintf(char* fmt, ...) { va_ list args; va_ start(args,fmt); printf(fmt,args); va_ end(args); } int _tmain(i...

How can I add reflection to a C++ application?

I'd like to be able to introspect a C++ class for its name, contents (i.e. members and their types) etc. I'm talking native C++ here, not managed C++, which has reflection. I realise C++ supplies some limited information using RTTI. Which additional libraries (or other techniques) could supply this information? ...

How to do a sample rate conversion in Windows (and OSX)

I am about to write an audio file converter for my side job at the university. As part of this I would need sample rate conversion. However, my professor said that it would be pretty hard to write a sample rate converter that was both of good quality and fast. On my research on the subject, I found some functions in the OSX CoreAudio-fr...

How do you properly use namespaces in C++?

I come from a Java background, where packages are used, not namespaces. I'm used to putting classes that work together to form a complete object into packages, and then reusing them later from that package. But now I'm working in C++. How do you use namespaces in C++? Do you create a single namespace for the entire application, or do yo...

C++ libraries to manipulate images

Do you know any open source/free software C++ libraries to manipulate images in these formats: .jpg .gif .png .bmp ? The more formats it supports, the better. I am implementing a free program in C++ which hides a text file into one or more images, using steganography. I am working under Unix. Thanks for any help in advance ...