NAT Traversal
I am trying to build a peer to peer application. I would like to know how I can accomplish nat traversal in c++. Is there any good library in c++ for this. Or any coding examples, books, links.... anything. ...
I am trying to build a peer to peer application. I would like to know how I can accomplish nat traversal in c++. Is there any good library in c++ for this. Or any coding examples, books, links.... anything. ...
I have a set of 250 header files and cpp files of my project. I wanted to format the old code and generate API documentation. Is there any tool that can help me do this? I am thinking of using DOxygen, but I believe that needs the information in a some format. ...
A common international issue is the conversion of double values represented in strings. These stuff is found in a lot of areas. Starting with csv files which are either called comma separated or character separated because sometimes they are stored like 1.2,3.4 5.6,6.4 in English regions or 1,2;3,4 5,6;6,4 in for example Ger...
When I use static variables in C++, I often end up wanting to initialize one variable passing another to its constructor. In other words, I want to create static instances that depend on each other. Within a single .cpp or .h file this is not a problem: the instances will be created in the order they are declared. However, when you wan...
I was reading the C++0x FAQ by Stroustrup and got stuck with this code. Consider the following code struct A { void f(double) { std::cout << "in double" << std::endl; } }; struct B : A { void f(int) { std::cout << "in int" << std::endl; } }; int main() { A a; a.f(10.10); // as expected, A.f will...
I want to minimise my application, take a screenshot of the current desktop and return my application back to its original state. This has been working fine under windows XP, however under testing on different Vista machines the minimise time of 200 milliseconds is no longer valid. Is there a way to ask the operating system when it has...
I am learning about pointers and one concept is troubling me. I understand that if you have a pointer (e.g.'pointer1') of type INT that points to an array then you can fill that array with INTS. If you want to address a member of the array you can use the pointer and you can do pointer1 ++; to step through the array. The program knows th...
class object { public: void check() { std::cout<<"I am doing ok..."<<std::endl; } }; int main() { object *p = new object; p->check(); delete p; p->check(); delete p; p->check(); } EDIT: Gurus, i am confused by many of the statements "it may crash or may not".. why isnt there a standard to say, this how ...
I'm just starting to learn programming. And as of now, I know a tad bit of memory management in Objective-C. It wasn't easy learning it. So, just out of curiosity, is the memory management employed in major languages like C, C++, Java, etc., in any way similar to what I've learned? ...
Hi. I'm looking for a minimal and easy to learn C or C++ cross platform gui library. In a nutshell I only need the following functionality: application window menu bar some simple dialogs, File-open and save. Maybe a user-written one. user canvas where I can draw lines an circles on. some kind of message/event loop mechanism. Targ...
I need to parse potentially huge XML files, so I guess this rules out DOM parsers. Is out there any good lightweight SAX parser for C++, comparable with TinyXML on footprint? The structure of XML is very simple, no advanced things like namespaces and DTDs are needed. Just elements, attributes and cdata. I know about Xerces, but its she...
I'm needing a fast method to read and store objects with pointers and pointers to pointers in xml files in c++ . Every object has it's own id , name , and class type. ...
When researching an answer to a question (based on this answer) I tried to do the following: template <class T> class friendly { friend class T; }; friendly<string> howdy; This fails to compile with the following error: error: template parameter "T" may not be used in an elaborated type specifier frien...
Logic error problem with the Gaussian Elimination code...This code was from my Numerical Methods text in 1990's. The code is typed in from the book- not producing correct output... Sample Run: SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS USING GAUSSIAN ELIMINATION This program uses Gaussian Elimination to solve the s...
I have a Windows DLL that at one point, returns a pointer to a class that is new'ed in the DLL's code. The class itself is a very thin wrapper around another class private to the DLL. The calling executable has no problem working with this class, everything works fine, with the exception that when the calling executable tries to delete ...
Duplicate of this question. Hi, I want to write a small program in C/C++ which reads a small text file, and encrypts it, using a "internal" key. Then I also want to write another small program which can decrypt the encrypted file using internally the same key. I looked at openSSL site and googled but found not simple example, has some...
Hello Folks, I'm trying to implement the MS Sitelock template into one of my Active-X Controls. I've downloaded the sitelock 1.15 sdk and I'm stuck on the very first step. Including the sitelock.h header file causes a bunch of compile errors that have to do with the sal.h header file. It looks to me like sitelock.h wants to use attr...
I have a template class that will bundle some information with a type: template <typename T> class X { int data[10]; // doesn't matter what's here really T t; public: // also not terribly relevant }; Then lets say we have a Base class and Derived class: class Base {}; class Derived : public Base {}; I'd like to be able to do...
I have a java app here that starts a C++ app via the java.lang.Process API and then tries to send commands to it via the stdin pipe: process.getOutputStream().write("foo\n"); process.getOutputStream().flush(); On the C++ side there's a loop running that checks for input in stdin and if there is some it reads it. Unfortunately the che...
Whenever I do a commit cycle in svn, I examine the diff when writing my comments. I thought it would be really nice to show the actual function that I made the modifications in when showing the diff. I checked out this page, which mentioned that the -p option will show the C function that the change is in. When I tried using the -p ...