c++

Is DbgHelp.dll built-in to Windows? Can I rely on it being there?

I use Jochen Kalmbach's StackWalker class from CodeProject, to produce a stacktrace when an exception occurs in my DLL. It relies on DbgHelp.dll Is DbgHelp.dll built-in to Windows Vista, WS2008, Windows 7? I know about The Debugging Tools for Windows from Microsoft, and I'm aware that DbgHelp.dll ships in that package. But I also f...

Is there a way to call an object's base class method that's overriden? (C++)

I know some languages allow this. Is it possible in C++? ...

C++ HashTable Question

If I use an array of linked list to implement a hash table, the "remove" function might require traversing through a "chain." Is this also true for "deleting"? ...

returning a pointer of a class through it's own functions

Is it possible to return a class through it's own function, so you can chain functions like below: class Foo; Foo.setX(12).setY(90); Can anyone confirm if this is possible, and how it would be achieved? ...

Visual Studio 2008 c++ conditional template inheritance bug?

I'm in the process of porting a C++/WTL project from Visual Studio 2005 to VS 2008. One of the project configurations is a unit-testing build, which defines the preprocessor symbol UNIT_TEST. In order to get my WTL classes into my test harness, I made a CFakeWindow class that stubs all the CWindow methods. Then in my stdafx.h file, I do...

Template specialization for enum

Is it possible to specialize a templatized method for enums? Something like (the invalid code below): template <typename T> void f(T value); template <> void f<enum T>(T value); In the case it's not possible, then supposing I have specializations for a number of types, like int, unsigned int, long long, unsigned long long, etc, then...

Passing around a nested functor (C++)

Is there a way to pass foo_ around outside of main? I saw something about Boost in another question regarding functors. That looks like it may work. Here's the answer mentioning Boost in that question. If I can, I would like to avoid Boost. #include <iostream> int main() { class foo { public: void operator()() { ...

Free tools that automatically reformat whole C/C++ source files in VS2008 on save?

I'm looking for a tool (macro, extension) for Visual Studio 2008 that would reformat the source code (C/C++) when you save the file. ...

Is there a way to make context-sensitive autocomplete for C++ in VIM?

Possible Duplicates: Autocompletion in Vim Vim, Python, and Django autocompletion (pysmell?) I don't know if that's the right word for it. When I use Ctrl+n in VIM to use autocomplete it doesn't do a very smart job of suggesting member functions or variables or what-have-you. Visual studio's intellisense makes suggestions that...

C++ library for making GUIs

Hi, I am looking for a simple C++ library for making GUIs. I tried wxWidgets and GTK, but I think both are complex. I want your opinion on what to use. Should I learn wxWidgets or you know a better one? Thanks. ...

Strange behaviour of edit control background color when using WinXp common controls

Hi! I am having a strange problem ( well, at least i find it strange =) ). I am writing my own GUI library, which is a wrapper around windows api (and yes, i am aware of WTL and frameworks like MFC =) ). At the current stage i have incapsulated common controls in such manner: for example, Edit class consists of a simple window and an sta...

Javascript receives ActiveX event only once

I've written an ActiveX control using ATL. I used the wizard to add support for connection points which added public IConnectionPointContainerImpl<CActiveX> and CProxy_IActiveXEvents<CActiveX>, where the CProxy_... is the wizard generated code to fire events. I've defined a dispinterface as follows: [ uuid(43ECB3DF-F004-4FAD-...

Strange gcc error: stray '\NNN' in program

The following issue popped up in my open source library, and I can't figure out what's going on. Two of my users have (gcc) compiler errors that look like: /home/someone/Source/src/._regex.cpp:1:1: warning: null character(s) ignored /home/someone/Source/src/._regex.cpp:1: error: stray ‘\5’ in program /home/someone/Source/src/._regex.cp...

Automate pimpl'ing of C++ classes -- is there an easy way?

Pimpl's are a source of boilerplate in a lot of C++ code. They seem like the kind of thing that a combination of macros, templates, and maybe a little external tool help could solve, but I'm not sure what the easiest way would be. I've seen templates that help do some of the lifting but not much -- you still end up needing to write forwa...

C++ Class Extension

Hi Is there a way to add new methods to a class, without modifying original class definition (i.e. compiled .lib containing class and corresponding .h file) like C#'s class extension methods? ...

Main's Signature in C++

The standard explicitly states that main has two valid (i.e., guaranteed to work) signatures; namely: int main(); int main(int, char*[]); My question is simple, would something like the following be legal? int main(const unsigned int, const char* const* argv); My tests say 'yes', but I'm unsure of the answer because am I not overlo...

What is the proper way to compare an element of an std::string with a character?

Hello, I am not a very experienced C++ programmer, i get a warning when i do the following: if (myString[i] != 'x') { } what is the appropriate way to compare these? thanks for your help! ...

Learning C++ on Linux or Windows?

Hi, Since you 'should' learn C/C++ and as part of 'learn as much languages as possible', i decided to learn C++ in depth. My OS is Windows and my question is should i re-install Linux as a dual boot to learn C++ on Linux? Do i miss something if I develop in C++ only on the Windows platform? (possible duplicate: http://stackoverflow.c...

Threading with .NET and OpenCV?

...

OpenCV Multi-thread call

I have made a program that has two threads, soon to be three, that is trying to get an image from a web cam from both threads at the same time. Is there a way to do this or is there a better way to do this? (using openCV 1.1) ...