c++

What is the best way to sync computer time with an internet time server?

I need to get the current time from one of internet time server in my desktop application. I suppose I need something like a request string and a regular expression to get time from any site that user wants (may be with several predefined sites). Or may be there are some free libraries exist? Thanks. ...

C++ cache file mean?

I got the C++ code as follows: string cachefile = filename + ".cache"; ifstream cache(cachefile.c_str(), ios::binary); As I did not find it in a C++ reference, what are these codes doing (like ifstream etc)? And what is the cache file please? Why should it be created? What are the advantages and how to interpret it? Above all, what ...

What is the purpose of "typename" in C++

Possible Duplicate: Officially, what is typename for? When I use template <typename TMap> typename TMap::referent_type * func(TMap & map, typename TMap::key_type key) { ... } what is the purpose of the two "typename"'s on the second line? It seems to trigger a compile-time warning (VS2008: C4346) but it's only a "do you c...

Symbols files and debugging

Assume i have a custom service written in VC++ 6.0 and i have shipped it as part of a particular release. Unfortunately i did not take the pdb while building the binary. At a later point of time my customer reported a crash and i had to get the pdb to identify the crash cause. Will a pdb that i take now be enough to identify the point o...

How do I detect memory access violation and/or memory race conditions?

I have a target platform reporting when memory is read from or written to as well as when locks(think mutex for example) are taken/freed. It reports the program counter, data address and read/write flag. I am writing a program to use this information on a separate host machine where the reports are received so it does not interfere with ...

Cloning rapidxml::xml_document

How do I get a complete copy of a RapidXML xml_document? There is a clone_node function; how to use to to create a complete copy of an existing document? ...

How to insert xml into Mysql?

Hi, this questions looks really easy but I'm a noob in C++ and MySQL so it still doesn't work. Here is the deal: I have a string (_bstr_t) that contains the xml and I want to store it in a longblolb column in MySql. Ways I tried that failed: write my xml on a local file and use mysql command LOAD_FILE, this worked localy but not on...

Help with this issue

My application allows rotating points around a center based on the mouse position. I'm basically rotating points around another point like this: void CGlEngineFunctions::RotateAroundPointRad( const POINTFLOAT &center, const POINTFLOAT &in, POINTFLOAT &out, float angle ) { //x' = cos(theta)*x - sin(theta)*y //y' = sin(theta)*x + cos(th...

How to perform inter-process(not thread) stream sharing with directshow?

Hi there I've succeeded to capture live video stream from my camera with directshow. But how can I share the stream to another process, any ideas? RGS! UPDATE Can illustrate with some code samples? ...

What does the colon mean in a constructor?

Possible Duplicates: C++ weird constructor syntax Variables After the Colon in a Constructor What does a colon ( : ) following a C++ constructor name do? For the C++ function below: cross(vector<int> &L_, vector<bool> &backref_, vector< vector<int> > &res_) : L(L_), c(L.size(), 0), res(res_), backref(backref_) { ...

New to C++, help me get started

Hey SO Im a Java programmer, with a little C knowledge who wants to get started with with C++ can someone recommend a good tutorial? also any help with: projects to learn with recommended reading what IDE ? I currently use NetBeans general C++ advice ...

undef'ing a function-like macro

Hello In the C/C++ there are 2 types of macro: #define ABC /* usual */ und #define FUNC(a) /*function-like*/ But how can I undefine them? Update: So there is no difference between undefing "constant-like macro" and "function-like macro" ? ...

Find out what version of Boost was used to compile an executable/DLL

Is there any way to use "strings" or some otehr command to decide what version of Boost was used to compile a particular executable or .so? All I have is the executable/.so itself. ...

generate a truth table given an input ?

Hello , Is there a smart algorithm that takes a number of probabilities and generates the corresponding truth table inside a multi-dimensional array or container Ex : n = 3 N : [0 0 0 0 0 1 0 1 0 ... 1 1 1] I can do it with for loops and Ifs , but I know my way will be slow and time consuming . So , I am askin...

Extract XML embedded in another XML using PugiXML

Is there an easy way in PugiXML to unescape and load an XML embedded in another XML. ...

Get file type from windows registry in c++

Hi, I am trying to display file type of given filename (based on extension) using AssocQueryKey() API function. The problem is thar return wrong HKEY value sometimes. For example the following function works correctly on win 7 ultimate x64, but fails for some extensions like ".mp3" on my win xp x86 machine (other extensions works though)...

Porting VC 6.0 Application to VS 2003 VC++ application

I have an application which is written in VC++ using VC 6.0 version. Now i open the project in VS2003. Does my project now have any link or relation with .Net framework as i am not using the .Net framework. Will the VC 7 compiler bring about a relationship with . Net. ...

How can I scan another process memory to find what follows a specific string?

I want to scan the entire heap of a currently running native application through another process. For example, I want to know what follows all the instances of the ASCII sequence "test" in this process memory (in this case I would scan for "test" and keep reading after it). I tried to google for more information but didn't find much: I...

Find current users active directory group C++

How would I go about querying what active directory group the currently logged in user belongs to? I am assuming it will be through LDAP but I havnt been able to find much on how to get this particular information. I have put together some code but im not quite sure what I need to do next // Open the access token associated with th...

Can I call `delete` on a vector of pointers in C++ via for_each <algorithm>?

Suppose I have a std::vector<Obj *> objs (for performance reasons I have pointers not actual Objs). I populate it with obj.push_back(new Obj(...)); repeatedly. After I am done, I have to delete the pushed-back elements. One way is to do this: for (std::vector<Obj *>::iterator it = objs.begin(); it != objs.end(); ++it) { delete *it...