Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Exception error using AVICOMPRESSOPTIONS

Posted on 1997-07-21
1
Medium Priority
?
297 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 100 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared 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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

721 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