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

x
?
Solved

Resource Dll

Posted on 1998-12-17
1
Medium Priority
?
247 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 200 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

824 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