HTML Resource

How can I get an Animated Gif to display in a HTML resource. I'm using CHTMLView and LoadResource. The res://
works fine for bitmaps but what about gif's, and more importantly animated gif's.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

#define MYGIF    100

// .RC
MYGIF    RT_RCDATA    "mygif.gif"

Tony_SebastianAuthor Commented:
#define GIF_DRUMS    160
// .RC
GIF_DRUMS    RT_RCDATA    "drums.gif"
//HTML resource code
src = "res://wizard.exe/#10/#160"

Didn't work. It still displays an empty GIF hole. I'm going to use an external html page and load it using navigate2.

Thanks for trying.
If this is still a problem, I think you can import the GIF file as a resource in your exe as a custom "GIF" resource type.  The syntax I think is similar to what you have there, but with a slight change:


There's more information at



I do this all the time :)

first you have to add the resource as an HTML resource or else your webbrowser control can't find it properly - in my experience

also I always put my gifs in the .rc2 file becuase if Visual Studio tries to interpret it in the resource editor it crashes (or it does on my machine)

so into your .rc2 file add the following


I know this works for GIFs and I can't see why it wouldn't work fo animated GIFs

you can then reference it like so




Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tony_SebastianAuthor Commented:
mweagle - Answer works !!! Although the documentation in the Internet SDK for res:// is mis-leading because it says you have to use res://<appname>/#<resource type>/#<resource ID>

where both resource type and resource ID have to be numbers and that they can not be identifiers.

Here's a blurb I copied from MSDN:

The following example shows the correct and incorrect way to format the numerical identifier for the resource type:

//winuser.h defines RT_BITMAP
#include <winuser.h>

//this is correct

//this is not correct

The following example shows the correct and incorrect way to format the numerical identifier for the resource identifier:

#define MYBITMAP 234

//this is correct

//this is not correct

I guess they're not talking about custom resources. Any way, thanks a million. Although I had a work around, I like this method better.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.