c++

how to create a vpn software

I want to create an application which creates a VPN between some endpoints, something like hamachi and i do not have a starting point. I haven't found any resource to explain how to create such a network application.I want to use c# because i have some experience with it. I really need some help, anything that can put me on the right way...

C++ problem in calling a function in main that prints the map.

Hi, I am trying to print the contents of the map and this is where my code fails. I have tested all my methods and I have no problem to read from file, filer the word, put it into map, and even the print function is working. However, when I am calling the printer function from main it does not print the map. I am new to polymorphism and...

C++/VS2005: Defining the same class name in two different .cpp files

Somewhat of an academic question, but I ran into this while writing some unit tests. My unit test framework (UnitTest++) allows you to create structs to serve as fixtures. Usually these are customized to the tests in the file, so I put them at the top of my unit test file. //Tests1.cpp struct MyFixture { MyFixture() { ... do some se...

How to get an object of a unknown class with given classname

I am searching for a way to determine at runtime, which type of object should be alloced (based on a given class name, which is of type const char*). Well the simplest way of course is to use loads of ifs /else ifs, but that doesnt seem applicable, because i have > 100 different classes(well at least they all derive from one base class)...

Problem with a trainer I'm trying to create (for educational purposes)

I'm trying to create a trainer for Icy Tower 1.4 for educational purposes. I wrote a function that shorten the WriteProcessMemory function like that: void WPM(HWND hWnd,int address,byte data[]) { DWORD proc_id; GetWindowThreadProcessId(hWnd, &proc_id); HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proc_id); ...

C++: Overloading operator=

Okay so I have a class that has 'weak typing' I.E. it can store many different types defined as: #include <string> class myObject{ public: bool isString; std::string strVal; bool isNumber; double numVal; bool isBoolean; bool boolVal; double operator= (const myObject &); }; I would like ...

Any good (really good) material on Poco C++?

Hardly can I find any good material on Poco C++. Their documentation cannot replace a good 3rd party tutorial enriched with real-world examples and lit with creativity. Please refer some if you know any. Thanks in advance. ...

What is best couple for developing small and fast GUI application with some graphical editor features - C++ and (VB or Win32)?

It has to make some time consuming calculations, so i need it to work as fast as possible. Also thought about Delphi. So. Is it a question of taste(or habit) or not and what can you advice me then? ...

Creating Windows Account using C++

Hi all, I will give a basic rundown of the situation first. I work for a game server rental company that is falling victim to an exploit inside of a major game engine (source). Basically, the developers left not one but two exploits inside the code, one to Send/Recieve files, and one that lets clients run plugins. Whats happening is cli...

Dealing with 32-bit code on Snow Leopard 64-bit?

I would like to create an XPCOM plugin for a XULRunner application that I'm building. Since Mozilla only provides a 32-bit build of the XULRunner SDK I have to link with 32-bit libraries. This means that a lot of libraries need to be built by me. Relating this I have a few questions: Can I do a sudo make install for a 32-bit build? Or ...

Can C++ export class from DLL

I would like to know if the export of class ( __declspec(dllexport) in VC++ ) is a kind of standard ( ANSI , ISO , ... ) I would like to know if someone has already try to do the same with intel c++ compiler and gcc ( mingw on windows ) and if it is possible to mix dlls generated from different compilers ( I really doubt that it is possi...

Good input validation loop using cin - C++

Hi there, I'm in my second OOP class, and my first class was taught in C#, so I'm new to C++ and currently I am practicing input validation using cin. So here's my question: Is this loop I constructed a pretty good way of validating input? Or is there a more common/accepted way of doing it? Thanks! Code: int taxableIncome; int error...

Review of beginner C++

Possible Duplicate: Resources online to learn C++ I'm a nontraditional student returning after a several year gap from school to study as a CS major. I've taken intro programming classes ages ago, and in about a week and a half I'm facing my first semester of classes since then. I'm taking a data structures course, and I just wa...

Passing a const vector<pointers> to a method but changing value pointed to

I have following code (only relevant portions shown for sake of brevity - please let me know if I have been too brief): class my_class { public: my_class() {m_i=0;} set(int i) {m_i = i;} private: int m_i; } void CallMod() { // create a bunch of my_class* o = new my_class() and store in vector<my_class*> // ...

removing strings from a vector via boost::bind

I am trying to remove short strings from a vector. std::vector<std::string> vec; // ... vec.erase(std::remove_if(vec.begin(), vec.end(), boost::bind(std::less<size_t>(), boost::bind(&std::string::length, _1), 5),...

HD Photo source compile on ARM?

I've downloaded HD Photo Device Porting Kit 1.0 and successfully compiled and executed it on x86 PC. I want to port the image viewer program to ARM-based Windows Mobile Smartphone, but there is some missing ARM code. First, no "/image/x86/x86.h" equivalent header file for ARM. But the file is very simple, so I copied and renamed it to ...

Window style and paint message

I created a window with WS_EX_LAYERED style, then i checked the first WM_PAINT message, I called BeginPaint to retrieve the area need to be paint, but the area i got is empty. But, when i create this window using WS_EX_LAYERED | WS_EX_COMPOSITED, i got the right area which need to be paint for the first WM_PAINT message. Why? Code fragme...

unable to successfully call function in dynamically loaded plugin in c++

I've successfully loaded a C++ plugin using a custom plugin loader class. Each plugin has an extern "C" create_instance function that returns a new instance using "new". A plugin is an abstract class with a few non-virtual functions and several protected variables(std::vector refList being one of them). The plugin_loader class success...

passing pointers from C to C++ and vice versa

Is there any tips one can give me about passing pointers to structs, doubles, functions, ... from a C program to a C++ library and back? ...

Dispatch Table in C++

Suppose I have something like the following: class Point : geometry { ... Point(double x, double y) { } double distanceTo(Line) { } double distanceTo(Point) { } } class Line : geometry { ... Line(double x, double y, double slopex, double slopey) { } double distanceTo(Line) { } double distanceTo(Poi...