I have a version resource in my resources in a C++ project which contains version number, copyright and build details. Is there an easy way to access this at run-time to populate my help/about dialog as I am currently maintaining seperate const values of this information. Ideally, the solution should work for Windows/CE mobile and earl...
I have to choose a platform for our product. I have to decide between The Qt Framework and Adobe's AIR. I am well versed with Qt as I have worked for the last two years. I looked up at the Adobe's site but all the info about flex, flash, ability to coding in HTML/ActionScript is overwhelming and confusing. I cannot understand the followi...
Does anybody know why
vector<int> test(10);
int a=0;
for_each(test.begin(),test.end(),(_1+=var(a),++var(a)));
for_each(test.begin(),test.end(),(cout << _1 << " "));
cout << "\n"
Gives : "0 1 2 3 4 5 6 7 8 9"
but
transform(test.begin(),test.end(),test.begin(), (_1+=var(a),++var(a)));
...(as before)
Gives : "1 2 3 ...
Hi,
I need to get at the image dimensions of a JPEG in C++. I'm looking for either a fairly simple way to do it, or a smallish library that provides that functionality. I'm working in C++ on OpenVMS, so any external libraries may have to be adapted to compile on our systems - so please don't post me links to big, closed source libraries...
I am using emacs + gdb to debug a bunch of .c files in unix -- and it always worked well. But some of the projects I work in also have a bunch of .pc (Pro*C/C++) files. These files generate .c and .i related files after compilation. But during runtime I am able only to see the .i files in gdb -- which are not useful for debugging and are...
In the Boost Signals library, they are overloading the () operator.
Is this a convention in C++? For callbacks, etc.?
I have seen this in code of a co-worker (who happens to be a big Boost fan). Of all the Boost goodness out there, this has only led to confusion for me.
Any insight as to the reason for this overload?
...
I am working on some code written by a co-worker who no longer works with the company, and I have found the following code: (which I have cut down below)
namespace NsA { namespace NsB { namespace NsC {
namespace {
class A { /*etc*/ };
class B { /*etc*/ };
}
namespace {
class C { /*etc*/ };
}
} } }...
How do I setup a class that represents an interface? Is this just an abstract base class?
...
I have written a parser in boost:spirit and now I wish to write the same stuff in antlr 3.1.1 to see if there are any performance gains or if it might be a better way to go about it as it also exports to many other languages besides c++ (The current 3.x branch actually does not export to c++).
3.1.1 is built using 2.7.x yet, it supports...
I don't need to validate that the IP address is reachable or anything like that. I just want to validate that the string is in dotted-quad (xxx.xxx.xxx.xxx) fomat, where xxx is between 0 and 255.
...
I'm trying to launch another process from a service (it's a console app that collects some data and writes it to the registry) but for some reason I can't get it to launch properly.
I basics of what I'm am trying to do is as follows:
Launch the process
Wait for the process to finish
Retrieve the return code from the process
I am cur...
Compiling a C++ file takes a very long time when compared to C#, Java. It takes significantly longer to compile a C++ file than it would to run a normal size Python script. I'm current using VC++ but it's the same with any compiler. Why is this?
The two reasons I could think of were loading header files and running the preprocessor, but...
I did select the executable correctly, because I can get it to respond to certain things I do. But I can't get ApplicationVerifier to properly detect a handle leak.
Here is an example:
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
...
I've got a structure as follows:
typedef struct
{
std::wstring DevAgentVersion;
std::wstring SerialNumber;
} DeviceInfo;
But when I try to use it I get all sorts of memory allocation errors.
If I try to pass it into a function like this:
GetDeviceInfo(DeviceInfo *info);
I will get a runtime check error complaining that I ...
there was a somewhat detailed thread (228684) on how to globally (using extern struct) declare a structure that could be seen in more than 1 c++ file, but I can not figure out exactly how to do it (there was a lot of discussion about do this, do that, maybe do this, try this, etc...).
couuld someone please post a very simple example of...
I'm refactoring a 500-lines of C++ code in main() for solving a differential equation. I'd like to encapsulate the big ideas of our solver into smaller functions (i.e. "SolvePotential(...)" instead of 50 lines of numerics code).
Should I code this sequentially with a bunch of functions taking very long parameters lists, such as:
int ...
Hi all,
The QMainWindow is the main window in a Qt application. So usually you'd have only one, but would it be possible at all to have multiple QMainWindow instances in your application?
I am working on integrating a Qt-based GUI application B into another Qt-based GUI application A. Both these applications have a QMainWindow, and I ...
I have a C++ application using WTL/ATL BEGIN_MSG_MAP_EX macros for message handling. I use some macros from atlcrack.h.
When we upgraded the projects to Visual Studio 2005, intellisense acts crazy. I've tracked the behavior down to the BEGIN_MSG_MAP_EX macro not behaving correctly with intellisense. However, I can not find a way to cont...
When creating a new C++ header/source file, what information do you add to the top? For example, do you add the date, your name, a description of the file, etc.? Do you use a structured format for this information?
e.g.
// Foo.cpp - Implementation of the Foo class
// Date: 2008-25-11
// Created by: John Smith
One team I know embeds...
I want boost::any_cast<T> to only throw an exception when the type of the any doesn't have an implicit conversion to T. The normal behaviour seems to be to throw an exception if the type of the any is not T, regardless of implicit conversions.
Example:
boost::any a = 1;
boost::any_cast<int>(a); // This succeeds, and rightfully so
boost...