c++

Memory leaks getting sub-images from video (cvGetSubRect)

Hi, i'm trying to do video windowing that is: show all frames from a video and also some sub-image from each frame. This sub-image can change size and be taken from a different position of the original frame. So , the code i've written does basically this: cvQueryFrame to get a new image from the video Create a new IplImage (img) wi...

Compare versions as strings

Comparing version numbers as strings is not so easy... "1.0.0.9" > "1.0.0.10", but it's not correct. Obvious way to do it properly is parse these strings, convert to numbers and compare as numbers. Is it other way to do it more "elegant"? For example, boost::string_algo... ...

specify parent window in Windows Resource Script file(*.rc)

Hi, I'm looking for a method to specify parent window in *.rc file. In *.rc file, it contains the layout and controls of a dialog. Any new control added into it, will automatically become a child window of Dialog itself. But I want to add a custom draw window into dialog, and some other controls which has that "custom draw window" as ...

Default and parametrised constructors

Is this statement true that declaring a constructor with arguments hides the default constructor and you cannot invoke the default constructor. ...

creating PHP C/C++ extension modules using SWIG

I have written some C/C++ extension modules for PHP, using the 'old fashioned way' - i.e. by using the manual way (as described by Sarah Golemon in her book). This is too fiddly for me, and since I am lazy, and would like to automate as much as possible. Also, I have used SWIG now to generate extensions to Python, and I am getting to li...

array of objects of a class

#include<iostream.h> class test{ int a; char b; public: test() { cout<<"\n\nDefault constructor being called"; } test(int i,char j) { a=i; b=j; cout<<"\n\nConstructor with arguments called"; } }; int main() { test tarray[5]; test newobj(31,'z'); }; In the above cod...

Problem with include guard

When I add an include guard to my header file for a Visual C++ project, it gives me the following warning and error: warning C4603: '_MAPTEST_H' : macro is not defined or definition is different after precompiled header use Add macro to precompiled header instead of defining here .\MapTest.cpp(6) : use of precompile...

Is there any C++ XSLT library?

I want to transform an XSD Document into XML Document(Template), is there any C++ XSLT library? ...

How operator new calls the constructor of class?

I know that, new operator will call the constructor of class. But how it's happening, what is ground level techniques used for this. ...

What is this error message mean and how to fix it

I receive the following error message: Windows has triggered a breakpoint in GDIMario.exe This may be due to a corruption of the heap, which indicates a bug in GDIMario.exe or any of the DLLs is has loaded. This my also be due to the user pressing F12 while GDIMario.exe has focus. The output window may have more diagno...

C++ enum in foreach

Possible Duplicates: Enumerate over an enum in C++ C++: Iterate through an enum I've have a card class for a blackjack game with the following enums: enum Rank { Ace, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King }; enum Suit { Clubs, Diamonds, Hearts, Spades }; When I create the deck I want to w...

A call to PInvoke function '[...]' has unbalanced the stack

Hey I'm getting this weird error on some stuff I've been using for quite a while. It may be a new thing in Visual Studio 2010 but I'm not sure. I'm trying to call a unamanged function written in C++ from C#. From what I've read on the internet and the error message itself it's got something to do with the fact that the signature in my C#...

Validate xml against xsd using c++

Hi , i am very new to xml and c++. i want to validate xml against xsd using c++ api.can any one gimme any tutorial link? or sample program.i don want to do using msxml as its works in windows and visual studio. i tried to use xerces and libxml but i have failed.now i am trying using tinyxml. please help me to validate xml against xml...

listen for events in c++

Hi I got a CWnd like thie CWnd * pWnd = pDC->GetWindow(); Is there away I can be notified when the windows is closing? ...

What is better: to delete pointer or set it with a new value?

Hi simple question in c++ , say i have a loop and i have function that returns pointer to item so i have to define inner loop pointer so my question is what to do with the pointer inside the loop , delete it ? or to set it with new value is good for example: for(int i =0;i<count();i++) { ptrTmp* ptr = getItemPtr(); // do somthi...

Deleting a node from a skip list

I'm having some problems deleting a node from a skip list. I have the following structures: struct Node { int info; Node **link_; Node(int v, int levels) { info = v; link_ = new Node*[levels]; for ( int i = 0; i < levels; ++i ) link_[i] = NULL; } }; struct List { int H; // l...

How do you redirect a standard stream of a C++ routine wrapped with SWIG and exposed to Python?

Is it possible to control the standard streams of C++ code in python? The code is wrapped with SWIG and then exposed to Python where I call one of its functions. I am getting all kinds of unwanted messages coming from C++ code and I want to suppress them either by not using the output stream or by redirecting it to a bit bucket, e.g. de...

Man pages for libvlc

Hi! all. Though I am not sure wether this question belongs to here but pardon me if not so. Can you people guide me to the manual page of libvlc functions like(just give a kind of pointer where these functions are described in detail) void libvlc_playlist_pause( libvlc_instance *, libvlc_exception ) mtime_t libvlc_inpu...

Using Qt with custom MinGW

Hi, I don't know if this question would fit better on superuser.com, but since it's rather compiler related, I give it a try here. I have to use Qt with a specific version of gcc (4.5). I downloaded the last official Qt release for Windows (Vista, 32 bits version) and didn't install the shipped MinGW version; I just installed the Qt li...

how to specify a pointer to an overloaded function?

I want to pass an overloaded function to the std::for_each() algorithm. e.g.: class A { void f(char c); void f(int i); void scan(const std::string& s) { std::for_each(s.begin(), s.end(), f); } }; I'd expect the compiler to resolve f() by the iterator type. Apparently, it (gcc 4.1.2) doesn't do it. So, how can I specify which ...