What are your favorite C++ coding style idioms? I'm asking about style or coding typography such as where you put curly braces, are there spaces after keywords, the size of indents, etc. This is opposed to best-practices or requirements such as always deleting arrays with delete[].
Here is an example of one of my favorites: In C++...
Hello all,
How can I place a MFC CFormView inside a CDockablePane which was introduced in the VS 2008 MFC Feature Pack?
Thanks.
...
I've got a console application that compiles and executes fine with Visual C++ 6.0, except that it will then only get as far as telling me about missing command line parameters. There doesn't seem to be anywhere obvious to enter these. How do I run or debug it with command line parameters?
...
I have built a windows C++ application that I'd like to port to linux. The main reasons to do this is ease of system maintenance for our IT staff. Apart from the one windows machine that runs this application we're a linux only operation.
The reason this application was built in-, and runs on- windows is that it uses a windows API (dll ...
I'm currently working on a project were I had to wrap the C++ classes with Python to be able to script the program. So my specific experience also involved embedding the Python interpreter in our program.
The alternatives I tried were:
Boost.Python
I liked the cleaner API produced by Boost.Python, but the fact that it would have requ...
I'm trying to expose this function to Python using SWIG:
std::vector<int> get_match_stats();
And I want SWIG to generate wrapping code for Python so I can see it as a list of integers.
Adding this to the .i file:
%include "typemaps.i"
%include "std_vector.i"
namespace std
{
%template(IntVector) vector<int>;
}
I'm running SWIG ...
The last week on the ACM ICPC Mexico competition, I missed a "return 0" on a C++ program. For this reason we got punished with 20 minutes.
I had read that the standard does not oblige us to write it at the end of a main function. It is implicit, isn't it? How can I prove it?
We were using a Fedora system with a G++ compiler.
...
I've got a dialog with several largeish combo boxes in it (maybe several hundred items apiece). There's a noticeable delay at construction while these are populated (confirmed that it's them by profiling).
My initial thought was that sorting was killing it's performance, but disabling sort and using InsertString instead doesn't seem to ...
In a progression of languages, I have been learning C and C++. Now I would like to learn C#. I know there are some drastic differences between them - such as the removal of pointers and garbage collection. However, I don't know many of the differences between the two.
What are the major differences that a C++ programmer would need to...
I want to extract images from a CImageList and save them as transparent GIF files. I'm using the following GDI+ code and the transparent area comes out black.
const HICON hIcon = myImageList.ExtractIcon( nImage );
Bitmap* gdiBMP = Bitmap::FromHICON( hIcon );
CLSID encoderClsid;
GetEncoderClsid( T2W( "image/gif" ), &encoder...
I am looking for a cross-platform solution for saving and viewing 3D scenes (visualizations of engineering simulation models and results) but there (still) doesn't seem to be much out there.
I looked into this almost 10 years ago and settled on VRML then (and started the project that eventually turned in OpenVRML). Unfortunately, VRML/X...
Let's say I have a source file with many preprocessor directives . Is it possible to see how it looks after the preprocessor is done with it ?
...
This has just come up as a question where I worked so I did a little digging and the answer is a ExpertsExchange one. So I hand you over to the original question asker, Manchung:
I have a project written in pure C which is to be used in embedded system. So, I use pure C to minimize the code size.
When I compile the project, I us...
How to identify the file content is in ASCII or binary file using c++?
...
I've always wondered why the C++ Standard library has instantiated basic_[io]stream and all its variants using the char type instead of the unsigned char type. char means (depending on whether it is signed or not) you can have overflow and underflow for operations like get(), which will lead to implementation-defined value of the variabl...
I keep stumbling on the format specifiers for the printf() family of functions. What I want is to be able to print a double (or float) with a maximum given number of digits after the decimal point. If I use:
printf("%1.3f", 359.01335);
printf("%1.3f", 359.00999);
I get
359.013
359.010
Instead of the desired
359.013
359.01
Can ...
Hi,
Is there a way to create C# objects and call methods from unmanaged C++, but without using COM Iterop? I am looking for something like JNI (but for .Net), where you can manually create the VM, create objects, etc.
...
I spend hours every week coding my own personal projects.
I have a nice C++ backend. For my next idea, it is small and lite enough to be done in flash. But i want to do it in a scripting language so i can call the code in my C++ projects. What script can i use in flash along with c++?
...
Hi,
I have an XLL Excel addin and now another team wants to use the same functionality in their project (unmanaged C++). Is there a way to interface with this XLL directly from C++?
...
We have an application that downloads some files in the background. Our application pops up when an Internet connection is made, and after prompting the user to accept the downloads, we'd like to switch back to the home screen while we do our stuff.
We can't work out how to do to this. We can emulate pressing "back" a few times, which s...