c++

dynamic code compilation

I'm working on a program that renders iterated fractal systems. I wanted to add the functionality where someone could define their own iteration process, and compile that code so that it would run efficiently. I currently don't know how to do this and would like tips on what to read to learn how to do this. The main program is written ...

about C++ pointer

Hi all, I have just started to practice c++ and I am stuck at one point. I have a Node class and the class has a constructor like this: class Node { public: Node(std::string,Node *,int,int,int,int); private: std::string state; Node* parent_node; int total_cost; int path_cost; ...

Can I add manifest file to someone else's exe?

Hi, I have some EXEs for which I do not have code. Can I still add manifest files? Also, according to my understanding of the topic, for a program to be Vista compliant, it should not write to any secured locations like HKLM, Program Files etc. For registry we can use HKCU, but about the files that are getting created in Program Files...

StretchDIBits failed, sometimes it draw nothing,...

I am using gdi c++, StretchDIBits function sometimes failed if I draw large Images such as 7000*5000. It draw nothing. GetLastError() says no enough system resource. Can anyone explain why StretchDIBits need resource even The DC is prepared successfully. ...

CreateDIBSection failed

BITMAPINFO bmi; memset(&bmi,0,sizeof(BITMAPINFO)); bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmi.bmiHeader.biWidth =m_pImg->GetWidth(); bmi.bmiHeader.biHeight =m_pImg->GetHeight(); bmi.bmiHeader.biPlanes = 1; //if( m_pImg->GetInfo()->biBitCount!=16) //{ // bmi.bmiHeader.biBitCount = m_pImg->GetInfo()->biBitCount; //} //e...

How do applications like Google Sidebar reduce the desktop size?

Hi, I'm trying to write an application which will sit at the top of the desktop on top of every window. I need this window however to not just sit on top of other windows, but to actually reduce the size of the desktop so when these windows maximise they don't get covered up by my application's bar. So, basically, I want my application...

Script to insert logging into every function in a project?

I have inherited a fairly large codebase, 90% C++, and I need to get up to speed on it quickly. There are hundreds of .cc files in a wide directory tree structure. It's fairly complex, and has no logging. In order to figure out how some major subsystems work, I want to insert a function call into every function. E.g., given a .cc f...

The power of .NET without the garbage collection?

I love C# because the powerful features of the .NET framework make it so easy to develop for Windows. However I also love standard C++ primarily because it gives me fine-tuned control over memory management. Is there a way to have the best of both worlds? Are there C++ libraries that can compete with the rich set of libraries in the .NET...

Challenge working with Visual Studio and VC++ ?

Dear Stackoverflow Readers, I have started working with C++ recently and am not comfortable with Visual Studio Development Environment and also I do not have proper understanding of MFC, Win32, ATL, COM Terminologies. From example point of view, I had taken a simple C++ program to see how it works with Visual Studio Environment and I ...

Why does IMPLEMENT_DYNAMIC require an empty constructor?

I have a class which overrides the default empty constructor to provide a constructor with a single parameter. If I use the mfc IMPLEMENT_DYNAMIC macro with this class, I get the error: no appropriate default constructor available. It's simple to solve by adding an empty constructor, but I wondered why this is needed. I am forced to make...

Parsing file in C++

I have some string data in the following format: "Ronit","abc""defgh","abcdef,"fdfd", Can somebody suggest some good code in C++ to return the comma-separated tokens, when the commas are not inside a string? I.e. it should return "Ronit" "abc""defgh" "abcdef,"fdfd" to be more clear Thanks all of you for kind help. Below is my sam...

How to determine if 2 paths reference the same file in portable C++

Hello. I was wondering if there is a portable way to determine if 2 different paths actually reference the same file. I have read this thread but is Windows-specific. AFAIK, fstream isn't suitable for the job. ...

How to get real code coverage using vsinstr/vsperfmon

Hi, my microsoft-based development environment looks like this: - huge native c++ codebase, seperated into 10 projects - each project has a dependent test project (GoogleTest unit tests), the sources to test are simply referenced. I generated the coverage-report using vsinstr and vsperfmon (the visual studio tools for instrumenting/...

Unable to create an operator== for a generic type?

I've got a generic range class and I'm trying to add a comparison operator so I can test whether one range is equal to another. It fails to compile and I'm not sure how to fix the issues it's complaining about. Have I missed something obvious? Here's a snippet of the code: generic<typename T> public ref class Range { protected: T m_...

References vs information hiding C++

Hi, I need suggestions on how to solve the type of problems described below. I'm fairly new at C++ and OO-design. I've learnt: Pointers shall be avoided when ever they can be replaced by references. Objects shall have no knowledge of objects that they don't need to know about. But when creating objects having references to other o...

Should I return bool or const bool?

Which is better: bool MyClass::someQuery() const; const bool MyClass::someQuery() const; I've been using 'const bool' since I'm sure I remember hearing it's "what the ints do" (for e.g. comparison operators) but I can't find evidence of that anywhere, mostly due to it being difficult to Google and Intellisense not helping out any ;) ...

Running C code directly in the browser?

Performance considerations aside, is there any known way to take existing C, C++, or Objective C code and run it directly in the browser? For example, a compiler that converts all the code into some interpreted language that can be run in the browser. Like Javascript, or Actionscript and the Flash player, or I suppose Java and the JVM. ...

Debugging 64-bit C++ from 64-bit .NET Code - how?

Visual studio tells me that 64-bit managed+unmanaged code debugging is not supported. Has anyone managed to resolve this problem? ...

Iterate keys in a C++ map

Is there a way to iterate over the keys, not the pairs of a C++ map? ...

C++ api for understanding tone signals on a phone line

Is there any good c++ source codes or api for handling phone lines like understanding tone signals. For example i like to find out if the person enters 3 (it's likely that this is done using it's tone sound). Do i need a special modem for this purpose or it can be done using only standard modems. ...