c++

Notification of drop in drag-drop in Windows

My C# program has a list of files that can be dragged from it and dropped into another program. My requirements are that the file be copied to a different directory first. So, can I be notified of the drop operation so that I can only copy the file if operation succeeds? I'd rather wait till I know it needs to be copied before actually ...

OpenGL Rotation

Hi, I'm trying to do a simple rotation in OpenGL but must be missing the point. I'm not looking for a specific fix so much as a quick explanation or link that explains OpenGL rotation more generally. At the moment I have code like this: glPushMatrix(); glRotatef(90.0, 0.0, 1.0, 0.0); glBegin(GL_TRIANGLES); glVertex3f( ...

C++ IDE for Linux?

I want to expand my programming horizons to Linux. A good, dependable basic toolset is important, and what is more basic than an IDE? I could find these SO topics: Lightweight IDE for linux and What tools do you use to develop C++ applications on Linux? I'm not looking for a lightweight IDE. If an IDE is worth the money, then I will...

Simple Frameworks for Displaying Bitmaps and Handling Button Presses

We have a set of applications that basically display a bunch of bitmaps and text, then allow user to press "buttons" (certain bitmaps) that cause actions to occur. We currently have these implemented using DirectX and a bunch of code to place the bitmaps and handle the button-presses. But we'd like to have the following features: por...

“rusage” statistics

Hello, I'm trying to use “rusage” statistics in my program to get data similar to that of the time tool. However, I'm pretty sure that I'm doing something wrong. The values seem about right but can be a bit weird at times. I didn't find good resources online. Does somebody know how to do it better? Sorry for the long code. class StopW...

Use QItemDelegate to show image thumbnails

What's the best way to use QT4's QItemDelegate to show thumbnails for images in a view? Specifically, how do you stop the item delegate from blocking when generating pixmaps from very large image files (> 500MB)? Can anyone link to some example code that achieves this? Then again, perhaps this isn't the place to look for Qt-specific c...

Using bitwise operators for Booleans in C++

Is there any reason not to use the bitwise operators &, |, and ^ for "bool" values in C++? I sometimes run into situations where I want exactly one of two conditions to be true (XOR), so I just throw the ^ operator into a conditional expression. I also sometimes want all parts of a condition to be evaluated whether the result is true o...

What's a good linux C/C++ IDE for a low-res screen?

I recently bought an Asus Eee PC 901, on which I am running Ubuntu linux. I was mucking around in C on my old (larger) laptop, and I want to continue to do so on the Eee. However, Anjuta - the IDE that I was using - is not very usable with the Eee's resolution of 1024x600. What with the status pane at the bottom, and the giant toolbar...

Is there a performance difference between i++ and ++i in C++?

We looked at this answer for C in this question: http://stackoverflow.com/questions/24886/is-there-a-performance-difference-between-i-and-i-in-c What's the answer for C++? ...

Is there a functional language for C++ ecosystem?

Java has Scala and .NET has F#. Both of these languages are very highly integrated into the respective Java and .NET platforms. Classes can be written in Scala then extended in Java for example. Does there exist an equivalent functional language that interoperates highly with C++? ...

stdbool.h c++

In a project I am interfacing between c++ and a c library that uses stdbool.h defined as such. #ifndef _STDBOOL_H #define _STDBOOL_H /* C99 Boolean types for compilers without C99 support */ /* */ #if !defined(__cplusplus) #if !defined(__GNUC__) /* _Bool builtin type is included in GCC */ typedef enum { _Bool_must_promote_to_int = -1...

What is the best free memory leak detector for a C/C++ program and its plug-in DLLs?

I have a .exe and many plug-in .dll modules that the .exe loads. (I have source for both.) A cross-platform (with source) solution would be ideal, but the platform can be narrowed to WinXP and Visual Studio (7.1/2003 in my case). The built-in VS leak detector only gives the line where new/malloc was called from, but I have a wrapper for...

Output compile time stamp in Visual C++ executable?

How can I insert compilation timestamp information into an executable I build with Visual C++ 2005? I want to be able to output something like this when I execute the program: This build XXXX was compiled at dd-mm-yy, hh:mm. where date and time reflect the time when the project was built. They should not change with each successive...

What's the best toolchain for Continuous Integration with C++?

Continuous Integration toolchains for .NET and Java Continous Integration are relatively well defined, but the C++ market seems to have less consensus. By CI "toolchain" I specifically mean tools for the build scripts, automated testing, coding standards checking, etc. all with preference given to tools that integrate with CI tools eas...

Overloaded functions in C++ DLL def file

I'm writing a C/C++ DLL and want to export certain functions which I've done before using a .def file like this LIBRARY "MyLib" EXPORTS Foo Bar with the code defined as this, for example: int Foo(int a); void Bar(int foo); However, what if I want to declare an overloaded method of Foo() like: int Foo(int a, int b); As the de...

Template typedefs - What's your work around ?

C++ 0x has template typedefs. See here. Current spec of C++ does not. What do you like to use as work around ? Container objects or Macros ? Do you feel its worth it ? ...

RSS Feed Library for (Unmanaged) C++

I'm looking for an rss library I can integrate into an existing windows MFC/C++ application. Does anyone know of such a thing? Or am I not finding one because people tend to use one of the many XML libraries out there and just enhance them to be specific to rss feeds? ...

What's your favorite profiling tool (for C++)

So far, I've only used Rational Quantify. I've heard great things about Intel's VTune, but have never tried it! Edit: I'm mostly looking for software that will instrument the code, as I guess that's about the only way to get very fine results. See also: What are some good profilers for native C++ on Windows? ...

How to convert std::string to LPCWSTR in C++ (Unicode)

I'm looking for a method, or a code snippet for converting std::string to LPCWSTR ...

Could you recommend some guides about Epoll on Linux

I need to know about Epoll On linux System. Could you recommend manual or guides about epoll library? need more detailed guides. it's better to have some examples. help me. and Thank you for reading. ...