c++

Career Choice between C#,ASP.NET and VC++

My affair with C# has run for about 3 years now, and I'm quite happy with it, at work I generally code web and console applications with MS SQL as the DB. But technically, I'm not advancing at a pace I expected to, the projects given to me are so simple that they don't require me to delve deeper into the programming language, I just know...

Is there a c++ library to include flash videos in a cross-platform application?

I'm developing a c++ applicaton using Qt, and we're looking to include swf files. Is there a way I can include swfs in my application? I'm open to different solutions for windows, mac, and linux, but a single cross-platform solution would be best. Thanks! ...

SCons, Boost::ASIO, Windows Precompiled Headers, and Linker Errors

I'm investigating using SCons for our build process as we develop C++ for multiple platforms. I'm 99% of the way there in the build configuration, but I'm running into a VERY strange error on Windows having to do with the precompiled header file. Even stranger still is that it only happens on one project. In the SConscript file for th...

C++ "hello world" Boost tee example program.

The Boost C++ library has Function Template tee The class templates tee_filter and tee_device provide two ways to split an output sequence so that all data is directed simultaneously to two different locations. I am looking for a complete C++ example using Boost tee to output to standard out and to a file like "sample.txt". ...

QT: custom widget in QScrollArea

I am attempting to create a custom widget. My Widget renders itself unless it is inside a scroll area. The code below works. If I change the if(0) to an if(1) inside the MainWindow constructor, it will not render the "Hello World" string. I assume that I must (re)implement some additional methods, but so far I have not been able to find ...

Question about pure virtual destructor.

If we define a abstract class which has a pure virtual destructor, why do we have to give a definition of a destructor in the abstract class? ...

"Undefined symbols" linker error with simple template class

Been away from C++ for a few years and am getting a linker error from the following code: Gene.h #ifndef GENE_H_INCLUDED #define GENE_H_INCLUDED template <typename T> class Gene { public: T getValue(); void setValue(T value); void setRange(T min, T max); private: T value; T minValue; T maxValue; }; #e...

(STL) Container of pointers

I'm having some trouble in declaring a STL Set of pointers to class instances. More specifically, I have this scenario: class SimulatedDiskFile { private: // ... public: // ... struct comparator { bool operator () (SimulatedDiskFile* const& file_1, SimulatedDiskFile* const& file_2) { return ((*file_1)->getF...

Thread Safe Data and Thread Safe Containers

Hi Guys I want to know what is the difference between thread safe Data and Thread Safe Containers ...

Cannot convert from 'const wchar_t *' to '_TCHAR *'

_TCHAR* strGroupName = NULL; const _TCHAR* strTempName = NULL; //Assign some value to strTempName strGroupName = _tcschr(strTempName, 92) //C2440 I get an error at the above line while compiling this code in VS2008. In VC6 it compiles fine. Error C2440: '=' : cannot convert from 'const wchar_t *' to '_TCHAR *' What seems to b...

How to learn c++ generic programming and template?

How to learn c++ generic programming and template? Recommend some good books about this topic. ...

Descriptor conversion problem

CRSAPublicKey* publicKey; const CRSAPublicKey &iRSAPublicKey= *publicKey; iEncryptor = CRSAPKCS1v15Encryptor::NewL(iRSAPublicKey); My problem is on the second line, because I have to pass a reference to function, for that I am creating reference from pointer. I don't know whether I am doing this right or wrong. First line compiles b...

Is C++ not a fully OOP Language??

As i know that, in OOP we have to declare anything i.e variable, function.. etc inside the class like in java, but in c++ we can declare outside the class also... is it the reason that, c++ is not fully OOP. or anything else.. anyone help me please........... ...

Error C2593: Operator = is ambiguous

typedef map<wstring , IWString> REVERSETAG_CACHE ; REVERSETAG_CACHE::iterator revrsetagcacheiter; . . . wstring strCurTag; strCurTag = revrsetagcacheiter->second; //Error C2593 Error C2593: Operator = is ambiguous Why does the above assignment give this error? It works in VC6. Does not compile in VC9. ...

Is there a faster way to detect object type at runtime than using dynamic_cast?

I have a hierarchy of types - GenericClass and a number of derived classes, InterestingDerivedClass included, GenericClass is polymorphic. There's an interface interface ICallback { virtual void DoStuff( GenericClass* ) = 0; }; which I need to implement. Then I want to detect the case when GenericClass* pointer passed into ICallba...

Boost serialization problem

Hi everyone, i have situation like this: class IData { virtual void get() = 0; virtual void set() = 0; } BOOST_ASSUME_IS_ABSTRACT(IData) BOOST_EXPORT_CLASS(IData) template<typename T> class ConcreteData : public IData { public: protected: template<typename Archive> void serialize(Archive& ar, const unsigned version) { ar &...

Possible to disable a hook made with SetWindowsHookEx run-time?

Hello. If an application (mine, or in an external process, for example) called SetWindowsHookEx, would it be possible for me to unhook the hook? Remember that it wasn't me who made the hook first place, so I don't have any kind of variables or pointers to the original hooks. ...

Can I stop COM from swallowing uncaught C++ exceptions in the callee process?

I am maintaining a project which uses inter-process COM with C++. At the top level of the callee functions there are try/catch statements directly before the return back through COM. The catch converts any C++ exceptions into custom error codes that are passed back to the caller through the COM layer. For the purpose of debugging I wa...

Using a C++ class member function as a C callback function

I have a C library that needs a callback function to be registered to customize some processing. Type of the callback function is int a(int *, int *). I am writing C++ code similar to the following and try to register a C++ class function as the callback function: class A { public: A(); ~A(); int e(int *k, int *j); }; A::A(...

Is it possible to forbid deriving from a class at compile time?

I have a value class according to the description in "C++ Coding Standards", Item 32. In short, that means it provides value semantics and does not have any virtual methods. I don't want a class to derive from this class. Beside others, one reason is that it has a public nonvirtual destructor. But a base class should have a destructor t...