c++

XPS open source implementation???

Does any know of any C/C++ open source for XPS [XML Print Specification]. I found http://www.ndesk.org/Xps, but it is c# ... Any help will be highly appreciated. ...

How to parse HTML in C++ ?

How would I go about parsing HTML in C++ on my Webserver Application? ...

How to code a new Windows Shell?

How would I go about coding a new Windows Vista Shell? ...

What is a packet UDP/TCP?

Im getting into Winsocks and is there any reference to tell me what a packet is. Like UDP/TCP Packets? ...

C++ g++ thread-safety constructors

Given: class Foo { Foo() {}; }; class Bar { static int counter; Bar() { ++counter; } } It's clear that Foo::Foo is thread safe whereas Bar::bar is not. Furthermore, it's clear that if a function is written in such a way so that it's not thread-safe, then clearly putting it in a constructor makes that constructor not thread saf...

C++ template black magic

This needs only work in g++. I want a function template<typename T> std::string magic(); such that: Class Foo{}; magic<Foo>(); // returns "Foo"; Class Bar{}; magic<Bar>(); // returns "Bar"; I don't want this to be done via specialization (i.e. having to define magic for each type. I'm hoping to pull some macro/template black magic...

Program crash in x64, works fine in Win32

I'm working on an application which builds and runs fine in Win32. However, in x64, it builds but crashes on run. Looking at the code and narrowing down the problem, if I comment out the call to the below function, it runs with no problem. void vec3_copy (double* v1, const double* v2) { v1[0] = v2[0]; v1[1] = v2[1]; v1[2] = v2[2];...

How to determine the size of an array of strings in C++?

I'm trying to simply print out the values contained in an array. I have an array of strings called 'result'. I don't know exactly how big it is because it was automatically generated. From what I've read, you can determine the size of an array by doing this: sizeof(result)/sizeof(result[0]) Is this correct? Because for my program, ...

Problem referring to the exe path in _wsystem() in Windows XP

I am having problem referring to the file path in Windows XP (SP2). Actually I want to run an exe file from a specified path say "C:\users\rakesh\Documents and settings\myexe.exe" in my program...I am using the function _wsystem("C:\users\rakesh\Documents and settings\myexe.exe") to run the file.. The problem is that it is not recognizin...

Exiting from C++ Console Program

I currently have a program which has the following basic structure main function -- displays menu options to user -- validates user input by passing it to a second function (input_validator) -- if user selects option 1, run function 1, etc function1,2,3,etc -- input is requested from user and then validated by input_validator ...

Equivalent to toString() in Eclipse for GDB debugging

In Eclipse I can override the toString() method of an Object to pretty print it. This is especially useful because during a debug sessions as I can click on a variable and see the object in a human readable form. Is there any kind of equivalent for C++ during a gdb session. I'm also open to any IDEs that can emulate this behavior. ...

If changing a const object is undefined behavior then how do constructors and destructors operate with write access?

C++ standard says that modifying an object originally declared const is undefined behavior. But then how do constructors and destructors operate? class Class { public: Class() { Change(); } ~Class() { Change(); } void Change() { data = 0; } private: int data; }; //later: const Class object; //object.Change(); - won't co...

How to make G++ preprocessor output a newline in a macro?

Hello, Is there a way in gcc/g++ 4.* to write a macro that expands into several lines? The following code: #define A X \ Y Expands into X Y I need a macro expanding into X Y ...

GetTextExtentPoint32 equivalent on Mac OS X

I am working on a cross platform library that needs to draw text using fonts into a device context. The width of the text combined with the user selected font is proving difficult to calculate. In Windows we use BOOL GetTextExtentPoint32(HDC hdc, LPCTSTR lpString, int cbString, LPSIZE lpSize) this works without problem. On Mac OS X we u...

WinPCap Data Getting Truncated

Working on parsing Arp packets and I found this nice problem. when receiving an Arp packet I was parsing the target's IP address. I have c0 a8 in my hex dumb but after that it ends. I am missing data! I see the data in Wireshark but I am not getting the data through WinPCap. I have yet to run into this issue before. Any ideas SO? So f...

Find a window using c++ and modifying controls

I would like to use c++ without mfc(and not clr) in order to modify textbox's and activate a button on a form outside of my project. I don't know where to start. I've done a lot of searching but can only find information for VB. A starting point would help. Thanks. I tried this and it doesn't seem to work. HWND fWindow = FindWindow(NU...

Don't understand the const method declaration

Too much C# and too little C++ makes my mind dizzy... Could anyone remind me what this c++ declaration means? Specifically, the ending "const". Many thanks. protected: virtual ostream & print(ostream & os) const ...

Expected constructor, destructor, or type conversion before '*' token

I honestly have no idea why this is happening. I checked, double-checked, and triple-checked curly braces, semicolons, moved constructors around, etc. and it still gives me this error. Relevant code follows. BinTree.h #ifndef _BINTREE_H #define _BINTREE_H class BinTree { private: struct Node { float data; Node...

What is the difference between setjmp() and longjmp() in c++ i am confused

What is the difference between setjmp() and longjmp() in c++ i am confused ...

C++ keyword mutable

Possible Duplicate: C++ mutable keyword What does the keyword mutable do in the following C++ code: class X { mutable int x; ... }; ...