c++

how to play /streem youtube/FLV videos from c++ application

Hello all i like to stream / play you tube videos or in general FLV files from c++ application how can it be done ? ( im using QT as GUI ) ...

CMake + find package or check out and install

Hello there! I just switched to CMake. And yet found it very useful and realized some simple apps and libs. Somewhere I read that it's possible to query git to checkout repositories from within cmake scripts. I'd like to check for the existence of a package with my Find(package).cmake If it doesn't exist i'd like to initiate a checkout...

Data structure that maps unique id to an object

I'm looking for a C++ data structure that will let me associate objects with a unique numeric value (a key), and that will re-use these keys after the corresponding object have been removed from the container. So it's basically somewhat of a hybrid map/queue structure. My current implementation is a std::map<size_t, TObject> and I ins...

Searching for embedded XML-RPC server (with SSL/TLS)

I'm searching for xmlrpc libraries that can be embedded in a C++ application. XmlRpc++ on SourceForge is a very neat solution but doesn't provide HTTPS support. Other RPC-like solutions such as gSOAP are not free for commercial use (or do I get that wrong, they mention a MPL-like license, too). What about Apache's Axis/C++, can it be e...

Will `typedef enum {} t` allow scoped enum element identifiers in C++0x?

I believe the new C++ standard allows for an extra "scope" for enumerated types: enum E { e1, e2 }; E var = E::e1; Since I know lots of source files containing the old C-style enum typedef, I wondered if the new standard would allow using the typedef for these otherwise anonymous enumerated types: typedef enum { d1, d2 } D; D var = ...

How do I define a friend class from the global namespace in another namespace?

In a previous Q&A (How do I define friends in global namespace within another C++ namespace?), the solution was given for making a friend function definition within a namespace that refers to a function in the global namespace. I have the same question for classes. class CBaseSD; namespace cb { class CBase { friend class ::CBaseSD...

C++ and Enum and class memebers

Following code is not compiling, can anybody please help what is wrong here class CTrapInfo { public: enum GenericType { ColdStart, WarmStart, LinkDown, LinkUp, AuthenticationFailure, EGPNeighborLoss, EnterpriseSpecific }; CTrapInfo(); CTrapInfo(cons...

How to change height of owner drawn listbox dynamically in windows mobile?

Hi, I am trying to create owner drawn listbox on windows mobile 6.1 I have specified LBS_OWNERDRAWFIXED style while creating listbox control. I am handling WM_MEASUREITEM and WM_DRAWITEM accordingly. I want to change height of listbox item whenever its font changes (I change it using WM_SETFONT after creating control). The problem is ...

Is there any way to specify a generic argument to a function with the restriction that it should implement a given interface

Example: I have a function that works with vectors: double interpolate2d(const vector<double> & xvals, const vector<double> & yvals, double xv, double yv, const vector<vector<double> > &fvals) { int xhi, xlo, yhi, ylo; double xphi, yphi; bracketval(xvals,xv,xhi,xlo,xphi); bracketval(yvals,yv,yhi,ylo,yphi); return (f...

GUI Framework/Lib for C++ under Windows

Hi! I was wondering is there an Microsoft alternative to MFC, except WinForms in GUI programming for Windows operating system ? I dont want to use thirdparty (Borland/Qt/wxWindows) libraries. WinForms require .NET which is major problem (can't install .NET in destination machines) and MFC is traumatic to me... Any alternative which w...

SSL_CTX_use_PrivateKey_file fail on Linux (part 2)

For some reason, my calls to OpenSSL's SSL_CTX_use_PrivateKey_file have started to fail (again) on Ubuntu. My previous post concerning this function; http://stackoverflow.com/questions/2028862/ssl-ctx-use-privatekey-file-fail-under-linux With the above fix, I have been able to use things fine until a couple of days ago. I have no idea w...

Questions about the static keyword with functions and data

I have a few questions about the static keyword in C++ (and probably with other languages as well.) What is the purpose of declaring a function as static? void static foo(int aNumber) { ... } How about a static inline function? void static inline foo(int aNumber) { ... } Is there any benefit to using the static keyword with a functio...

remove directory in c++

how to remove a entire directory in c++ ...

How to return different classes from one function?

Hi I have a question, though it is not limited to C++. How to return totally different class from one function? f() { in case one: return A; in case two: return B; in case three: return C; } For example, I have two balls in the space, according to the position and the size, there are three situations for the two balls to intersec...

How do I convert a char* to an int?

I need to convert a char* to an integer. For example: data.SetBytFldPos(*attribute->value()); The value in the attribute class is a char*. 'SetBytFldPos" takes an int. ...

What is the difference between asio::tcp::socket's async_read_some and async_receive?

What is the difference between: boost::asio::tcp::socket::async_read_some() boost::asio::tcp::socket::async_receive() As far as I can tell their documentation is identical. Which should I prefer? ...

Forward declaration of nested enum

Hi all, I have code similar to the following: class B { } class A { enum { EOne, ETwo } EMyEnum; B myB; } I want to declare a member of type EMyEnum in class B (which is declared before A). Is this possible? I realise the solution is to declare class B second, but for clarity I would prefer not to. ...

How do I specialize a templated class for data type classification?

We use boost - so using that library should be fine. But I've never managed to wrap my head around creating a set of templates which give you the right specialization for a whole class of data types, as opposed to specializing for a single data type (which I know how to do). Let me go for an example to try to bring this down to earth. ...

String and character mapping question for the guru's out there....

Here's a problem thats got me stumped (solution wise): Given a str S, apply character mappings Cm = {a=(m,o,p),d=(q,u),...} and print out all possible combinations using C or C++. The string can be any length, and the number of character mappings varies, and there won't be any mappings that map to another map (thus avoiding circular d...

Is it possible to use COM visible .NET classes with registration free COM?

We're developing a ClickOnce application with a mixture of .NET components and legacy C++ COM components. Currently we're adding the C++ COM components to the users machine using an MSI (this is a prerequisite to installing our ClickOnce app) which means we can register the COM objects on the user's machine beforehand. We can still pu...