c++

Can I transform an object and access the private data members in C++?

I want to access a private data member in a class. There is no member function in the class to access the private data member. It is private. I want to take the class and some how crack it open. One method was to copy the declaration of the class, make the private member public and call the new class class something_else. Then I do a r...

Using GTK+ in Visual C++

Hello, I want to use GTK for user interface for C++ project. I do not know how to set development environment for it. I downloaded all-in-one bundle of gtk from http://www.gtk.org/download-windows.html How to use it with visual c++ 2008 ? ...

Legacy-C C++ incorporation

Hi all. I'm currently working on a performance critical application which incorporates legacy c code (a SPICE variant). The problem is as follows: The creators of the legacy c code apparently believed that the use of argument passing is one of the great evils of the modern age. Thus about 90% of all the variables were declared globa...

debugging 64 bit dumps in visual studio

Is there any way to use visual studio to debug a dump of a 32 bit app that was produced on a 64 bit computer. I have got WinDbg working but the output is so jumbled i cant work out whats going on. Visual Studio 2008 ...

How to restrict proccess to create new processes?

How to restrict proccess to create new processes? ...

C++ - How to reset the output stream manipulator flags

I've got a line of code that sets the fill value to a '-' character in my output, but need to reset the setfill flag to its default whitespace character. How do I do that? cout << setw(14) << " CHARGE/ROOM" << endl; cout << setfill('-') << setw(11) << '-' << " " << setw(15) << '-' << " " << setw(11) << '-' << endl; I thought this ...

Resources on creating a GUI Layout Manager?

I have been working on a simple GUI and have hit a roadblock. I haven't found any examples or even readable source on how to create a GUI layout manager. I was wondering if anyone knew of some resources on creating one, or some source code that isn't cryptic like Qt's layout engine. Thanks. ...

Optimized Project Structure in Eclipse CDT

Hi, I'm in a c++ project on linux in the starting stages. (team contains 3-5 developer, IDE is Eclipse CDT 6) And i'm wondering your ideas about what should be the project structure about the following subjects: Dependency management, how would you reference different sub-project directories in the same project Building system, handwri...

Scripting language for C/C++??

Is there a scripting language for C++ (like perl) which can be used for rapid development and use some tool which can convert into C/C++ program to get higher performance for deployment? EDIT: Based on some commented, let me clarify the question. I should be able to convert script into C/C++ program or binary without modifying my sc...

Disable automatic DLL loading in C++

My scenario is as follows: my application depends on a certain DLL (I use it's lib during linkage). However, when my application executes, I want to explicitly load that DLL using LoadLibrary. However, by default, when the code reaches a scope where that DLL is needed, the environment automatically look it up, and then loads it. I want t...

RegQueryValueEx - What code add to this function to show ERROR_SUCCESS

What code add to this function to work good? (ERROR_SUCCESS) I have code, that check value in registry. In function RegQueryValueEx is bug. When oldValue is few letters longer than newValue, function shows ERROR_MORE_DATA, but I want want ERROR_SUCCESS What code add to this function to do this? void function(string newValue, string k...

Removing from STL std::queue without destructing the removed object?

All the documentation I can find on the STL containers (both queue and list) say that for any of the remove functions the removed object's destructor is called. This means that I can't use std::queue any time I want a queue that's simply a list of objects needing some operation performed on them. I want to be able to add objects to the...

Binding operator new?

I'd like to bind operator new (see example below). If the constructor doesn't have any arguments, it works fine, but if it does have arguments, I apparently have trouble getting the bind syntax correct. #include <map> #include <boost\function.hpp> #include <boost\lambda\lambda.hpp> #include <boost\lambda\construct.hpp> #include <boost\...

c++ overload operator==

I have a class with the following bool DistinctWord::operator==(const DistinctWord W) const { return strWord == W.strWord; } bool DistinctWord::operator==(const DistinctWord& W) const { return strWord == W.strWord; } I'm doing this in my program DistinctWord* wordOne = new DistinctWord("Test"); DistinctWord* wordTwo ...

Accessing members of an object that hasn't been initialized?

I'm not very familiar with C++ programming. I know the basics of programming in it (syntax, pointers, etc.) and I've built a few basic programs with it and done some basic debugging at work. I am puzzled by this line of code from Box2D, specifically the Box2dTest project from Cocos2D: // Define the ground body. b2BodyDef groundBodyDef; ...

Can I declare a function that can take pointer to itself as an argument?

Reading a question in stackoverflow, I wondered whether it's possible to declare a function that takes a pointer to itself. I.e. to make such declaration of foo, for which the following would be correct: foo(foo); The simpliest idea is casting to another function pointer (can't cast to void*, since it may be smaller), so the function...

stl::find_if with user search

I was wondering if there was a way to use the stl::find_if to search for a user inputted value I don't know to do that without using any bad conventions(globals) or adding loads of extended code. For example, if a user inputs a int x for 10, then I want to search an vector of ints iterator = find_if(begin,end,pred) //but how does pre...

What is different about the CMake command configure_file on Windows?

On linux I am using a command such as: configure_file(dot_alpha_16.bmp test/dot_samples/dot_alpha_16.bmp COPYONLY) to copy some unit test files to the build directory. On windows the files aren't getting copied. Is there a specific reason why this happens? ...

If Linked List and Array are fundamental data structures what type of data structure are tree, hash table, heap etc ?

Hi, I was going through data structure online class and it was mentioned that linked list and array are fundamental data-structures and so my question is about Hash table, Heap, tree and graph are those not fundamental data structures and if not are they derived from any other data structure ? Thanks. ...

What makes smartpointers better than normal pointers?

What makes smartpointers better than normal pointers? ...