Solved

Resource Dll

Posted on 1998-12-17
1
231 Views
Last Modified: 2011-09-20
I have a resource dll of bmps that I am using to hold the frames of an animation sequence.  When the dll is first loaded the animation plays slowly on the first pass.  After that the animation plays much quicker...
Is there a way to somehow preload the resource to speed the initial pass through?
0
Comment
Question by:gpaige
1 Comment
 
LVL 8

Accepted Solution

by:
Answers2000 earned 50 total points
ID: 1180427
Yes and you already have the answer your hands....

Make a dummy pass of LoadBitmaps and retain the handles, say in an array)

Re-use these handles each time you play the animation (rather than doing LoadBitmap each time you play a frame, which of course is the cause of your variable speed).

Another solution is to call a (dummy) function in the DLL or access a dummy resource, before playing the animation.  This is not as good.  If the DLL is large, it will tend to get swapped out, again cause variable speed.

Finally one suggestion I think you  should consider is to use an AVI and the animation control (CAnimateCtrl in MFC, but you can also use these in non-MFC programs).  This seems to rarely suffer from this kind of problem
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

758 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

21 Experts available now in Live!

Get 1:1 Help Now