VC++ program with OpenCV - CImage to IplImage

All right so I'm doing a project which involves a camera and OpenCV. I get to the point where I store the image as a CImage but I need to load it as an IplImage so that I can do some processing. Here's what I've tried so far but have gotten no where:

1. Save it to disk using the CImage::Save() method and use cvLoadImage(). Tried it and I get the desired effect, but when I stream images from the camera and output it as video onto the screen, my program crashes after some time (usually a couple minutes). If I get that problem solved I won't have to do the CImage to IplImage conversion.

2. Convert the CImage tp IplImage directly. I figured I can use cvGetImage() to convert a cvArr to an IplImage but I don't know how to get my CImage into a cvArr. Tried using CImage::GetBits(), but I got confused and called it a day. Any ideas?

All help is appreciated, thanks!
Topic archived. No new replies allowed.