Solved

Exception error using AVICOMPRESSOPTIONS

Posted on 1997-07-21
1
280 Views
Last Modified: 2013-12-03

I am having problems using the AVICOMPRESSOPTIONS structure in my program in Borland C++ Builder.  I declared the structure and used it in the following manner:
AVICOMPRESSOPTIONS *compopts[3];

compopts[0]->dwFlags = AVICOMPRESSF_KEYFRAMES;
<Exception error right here...>

It compiled fine until the "compopts[0].." line gets executed...  The compiler gives me an exception error saying "Access violation at address ... .  Memory read FFFFFFFF"
(Or something to that sort).
Can someone please help?  Thank you.

Sincerely,
Dan
0
Comment
Question by:dannil
1 Comment
 
LVL 4

Accepted Solution

by:
AVaulin earned 50 total points
ID: 1401543
You use pointers array but you didn't allocate memory. Do like this:

AVICOMPRESSOPTIONS *compopts[3];

for( int i=0; i<3; i++ )
 compopts[i] = new AVICOMPRESSOPTIONS;

compopts[0]->dwFlags = AVICOMPRESSF_KEYFRAMES; // must be OK

Be sure to use:

for( int i=0; i<3; i++ )
 delete compopts;

when you will not need "compopts".
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question