c++

Resolving RVA's for Import and Export tables within a PE file.

I am currently writing a PE parser/loader. I have successfully loaded the PE file into memory using standard c file io, retrieved valid DOS and PE headers (the optional header) as well as gaining access to the PE's sections. My next target is to gain access to the Export table to retrieve exported symbols. To do this i have used the RVA ...

C++ coding standards

Possible Duplicates: C And C++ Coding Standards What existing style and coding standard documents should be used on a C++ project? How to acheive coding standards in C++? Any reference books? ...

Is leaked memory freed up when the program exits?

The title says it all: If I programmed without knowing it a memory leak, and the application terminates, is the memory of the memory leak freed? ...

Purpose of stdafx.h

What is the purpose of stdafx.h file and what is meant by precompiled headers. ...

C++: Can I get out of the bounds of my app's memory with a pointer?

Hi, If I have some stupid code like this: int nBlah = 123; int* pnBlah = &nBlah; pnBlah += 80000; *pnBlah = 65; Can I change another app's memory? You have explained me this is evil, I know. But I was just interested. And this isn't something to simply try. I don't know what would happen. Thanks ...

C++: synchronize 5 consumers to 1 producer (multithreaded)

Hi all, I have five consumers and one producer. The five consumers each output different data, from the one producer, for ~10ms. During those 10ms the producer prepares the parameters for the next output. When the output parameters are set, I want to set a flag instructing the consumers to begin the next output. I only want the producer...

Getting empty update rectangle in OnPaint after calling InvalidateRect on a layered window

I'm trying to figure out why I've been getting an empty update rectangle when I call InvalidateRect on a transparent window. The idea is that I've drawn something on the window (it gets temporarily switched to have an alpha of 1/255 for the drawing), and then I switch it to full transparent mode (i.e. alpha of 0) in order to interact wi...

C++: How do applications like Cheat Engine and ArtMoney work?

After asking this question (C++: Can I get out of the bounds of my app’s memory with a pointer?), I decided to accept it isn't possible to modify other app's memory with pointers (with a modern OS). But if this isn't possible, how do programs like ArtMoney and CheatEngine work? Thanks ...

adjust bitmap image brightness/contrast using c++

adjust image brightness/contrast using c++ without using any other 3rd party library or dependancy ...

C++ dynamic array of matrices (from scythe statistical library)

I am trying to use the scythe statistical library (found here: http://scythe.wustl.edu/). I can initialize a matrix just fine with: Matrix<double> A(2, 2, false); But I would like to have a dynamic array of such matrices. Does anyone have any hints? Do I use vector? If so how? Many thanks! ...

Compile and link errors

Are there strategies or methods to identify whether a particular piece of code or program will generate a link error or a compile error. ...

Difference between iostream and iostream.h

What is the difference between iostream and iostream.h? ...

IShellLink::SetIconLocation translates my icon path into %Program Files% which is WRONG

Does anyone know how to correct for this behavior? Currently, when our installer installs our application, it obtains an IShellLink, then loads it up with the data necessary for our shortcut icon (in the start menu & desktop), and then uses IPersistFile::Save to write out the shortcut. The problem is that the path specified for the ico...

Linking a GUI toolkit to C++ input

Hey there! This is my first time asking here but I've been a reader for ages! A fantastic place to learn! I was asked to design a simple board game as a programming project this semester (using C++) and to implement GUI for a bonus mark. I was rather lost reading through tens of possible GUI toolkits and not knowing which one to use. I'...

gethostbyname creates a thread??

Hello, I am working in C++ with VS2008 and Win7. While examining a program I was following the threads created, and it seems that gethostbyname() creates a thread for itself. Could you explain why? On msdn is says: "The memory for the hostent structure returned by the gethostbyname function is allocated internally by the Winsock DLL...

Exposing a std::list as read only

I have a class that contains, among other things, an std::list. I want to expose this list but only in such a way that the structure and the data it contains are read only, but still can be used with iterators. The way I've got it 'working' atm is to return a copy of the list. This leave my class 'safe' but of course does nothing to sto...

Redirect a TCP connection

Hi there, I have something like a proxy server (written in java) running between my clients and the actual video server (made in c++). Everything the clients send goes through this proxy and is then redirected to the server. It is working fine, but I have some issues and think it would be better if I could make this proxy server only to...

Public Data members vs Getters, Setters

Hi All, I am currently working in Qt and so C++. I am having classes that has private data members and public member functions. I have public getters and setters for the data members available in the class. Now my question is, if we have getters and setters for data members in our classes then what's the point in making those data mem...

How to exchange data between programs using the terminal?

I have a program which continually receives data from an external source and prints it to the terminal. I am now trying to create a GUI to display the received data. Is there some way for me to do this without changing the pre-existing code (that is the old code calls a print statement and what is printed gets displayed in the GUI)? ...

C++ boost mpl vector

I understand that the following code won't work, as i is a runtime parameter and not a compile time parameter. But i want to know, whether there is a way to achieve the same. i have a list of classes and i need to call a template function, with each of these classes. void GucTable::refreshSessionParams() { typedef boost::mpl::vect...