Solved

Exception error using AVICOMPRESSOPTIONS

Posted on 1997-07-21
1
266 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

762 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now