c++

Creating an OS close button? (WinAPI)

I want to create a button that is basically Windows' close button. How could I do this? I want to avoid drawing this myself because I want it to look like that version of Windows' close button. Firefox's tabs do something like this. Thanks ...

Forwarding all constructors in C++0x

What is the correct way to forward all of the parent's constructors in C++0x? I have been doing this: class X: public Super { template<typename... Args> X(Args&&... args): Super(args...) {} }; ...

Visual Studio Addin "Exclude From Build" Property

I am currently trying to create an addin for Visual Studio 2008 that will list all files which are not excluded from the current build configuration. I currently have test C++ console application that has 10 files, 2 of which are "Excluded From Build". This is a property that will allow a specific file to be excluded from a specific co...

Example showing how to add a button/menu to the glass part of a Vista window frame like Opera/Firefox 4

I'd like to add a menu to the glass part of the frame in a C++ application which is using WTL and Win32++. Those libraries are probably largely as this is something I'd need to do from Win32. The latest versions of Opera and the upcoming Firefox are going to be doing this but I haven't been able to find a code example. Has anyone got e...

Should I learn Java or should I learn C++?

I have a pretty good non-OOP background. I've done lots of Visual Basic coding, and a little SQL. I want to widen my skillset and be more marketable. Most of my experience has been working with scientific companies, and I've been supporting scientists a lot. I want to take some online classes from my local community college. Should I t...

strange garbage data when opening a previously truncated file

In my program, I've redirected stdout to print to a file 'console.txt'. A function writes to that file like this: void printToConsole(const std::string& text, const TCODColor& fc, const TCODColor& bc) { // write the string cout << text << "@"; // write the two color values cout << static_cast<int>(f...

eclipse C++ add reference undefined reference to method error

Hi Guys, I'm new to C++ and ecplice and they are definitely giving my a hard time :) I'm tring to write simple application that includes main project with refernces to other project i wrote the following file in shared project: #ifndef MANAGEDLOG_H_ #define MANAGEDLOG_H_ #include string #include iostream #include fstream ...

how to increase/decrease contrast of a bitmap using MFC?

how to increase/decrease contrast of a bitmap using MFC? ...

[Qt/C++] How can I make the mousePressed and mouseDoubleClicked events mutually exclusive ?

Hey guys ... Well I'm experiencing this silly problem that whenever I perform a double click event, two mousePressed events are also triggered, meaning that mousePressed event code is also executed twice for no reason .. How can I configure the event such that first the clicks are checked for doubleClick event, and only if this is NOT tr...

g++ template problem

Hello everybody. I'm porting my c++ windows code (msvc & intel) to Linux (g++). The code uses lots of templates (I like metaprogramming ;-). But I can't compile this code: template <class TA> struct A { template <class TAB> struct B; }; template <class TC> struct C {}; template <class TD> struct D { template <class TTD> clas...

Scientific Library Options for C or C++

I'm in the process of choosing a scientific library to use as a basis for a project. I need to do a lot of statistical, linear algebra, and signal processing tasks, and I figured there are probably some great libraries that already do this stuff better than I could program it myself. For c++, I know about Boost, but don't have much expe...

What is the difference between the following?

Possible Duplicate: Do the parentheses after the type name make a difference with new? Assuming A is a class properly defined with constructors etc., what is the difference between these? A *ptrA = new A; A *ptrA = new A(); ...

Ensuring fields are only added to the end of a struct?

I have a rather odd problem: I need to maintain a chunk of code which involves structs. These structs need to be modified by adding fields to them from time to time. Adding to the end of a struct is what you are supposed to do, and any time you add a field to the middle of a struct, you've broken the code in a non-trivial way. It's b...

Why is only one implicit conversion allowed to resolve the parameters to a function in C++?

This works: #include<cstdio> class A{ public: A(int a):var(a){} int var; }; int f(A obj) { return obj.var; } int main() { std::cout<<f(23); // output: 23 return 0; } while this doesn't: #include<cstdio> class A{ public: A(int a, int b):var1(a), var2(b){} int var1, var2; }; int f(A obj) { return (...

How to write modern Windows software in C++?

Hello everyone, I am very interested in how modern Windows software is written in C++ nowadays? I asked my friend who had worked on Windows software and he told that last things he worked with were MFC and then WTL. He said that MFC is no longer anything modern but WTL is still used but he didn't know much more. He also said that WTL wa...

[C++] A tricky counter - just a int, but he won't work as requested

Hello guys, I'm near the end of a program I had got to code for my university courses, but I got into a last trouble: formatting the output! It's nothing about code: this is just cosmetics (but I need to fix that cause my output's got to respect some standards). Basically, my program will read a .csv file and process that by dividing t...

WWAN and 802.11 ?

Hi, coding with C++ for WWAN and 802.11, is it complicated in an embedded environment? thanks ...

Is there a good library c/c++/java to generate video with special effects , transitions from a set of images ?

Hi, I need to develop a video generator that takes in a set of images, music files and outputs mp4 videos. The platform is linux. Was wondering if there are any existing libraries that can do this job ? Thanks ...

How to get VBO working

I tried to use this tutorial http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=45 I load it in my visual studio 2008, compile it, and it says missing file: "GLES/glplatform.h" so i google the file... then it whines missing file: "KHR/khrplatform.h", so i google that too... then it whines everything possible, "GLDouble undeclared id...

What to do with proxy class copy-assignment operator?

Consider the following proxy class: class VertexProxy { public: VertexProxy(double* x, double* y, double* z) : x_(x), y_(y), z_(z) {} VertexProxy(const VertexProxy& rhs) : x_(rhs.x_), y_(rhs.y_), z_(rhs.z_) {} // Coordinate getters double x() const {return *x_;} double y() const {return *y_;} double z()...