Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Exception error using AVICOMPRESSOPTIONS

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

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

972 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