Solved

Exception error using AVICOMPRESSOPTIONS

Posted on 1997-07-21
1
295 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 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