link to image in html inside CDHtmlDialog

Hi!
 I need to show html inside CDHtmlDialog. and inside this html must be some picture.
 The problem is, that I can't load it ( Program opens dialog with image placeholder, where is displayed red cross, not a picture I want to show ).

I've tried different things, like:
1) placing  <base url="res://myexe.exe/welcome.html"> in head tag of html
2) <img src="res://myexe.exe/#2110/7011" alt="Welcome"/>, where 7011 is IDI_SEC_WELCOME and other things.

Any help would be highly appreciated!
// HTML:
<html>
<head>
</head>
<body>
    <img src="welcome.bmp" alt="Welcome"/>
</body>
</html>

Resource File:

IDI_SEC_WELCOME         BITMAP      "welcome.bmp"
IDR_SEC_WELCOME          HTML       "welcome.html"

and CWelcomeHtmlDialog (which is derived from CDHtmlDialog):

BOOL CWelcomeHtmlDialog::OnInitDialog()
{
	CDHtmlDialog::OnInitDialog();
	LoadFromResource(IDR_SEC_WELCOME);
	return TRUE;  // return TRUE  unless you set the focus to a control
}

Open in new window

SpringMVCAsked:
Who is Participating?
 
ambienceCommented:
This is how I did it once
OPERATION.HTML          HTML                    "operation.html"

and it worked
0
 
ambienceCommented:
Try this
<base url="res://myexe.exe">
 
0
 
SpringMVCAuthor Commented:
Same thing..Program can't find image..
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
ambienceCommented:
Just to make sure:
With "welcome.bmp" as src, right? I mean the snippet below
<html>
<head><base url="res://myexe.exe"></head>
<body>
    <img src="welcome.bmp" alt="Welcome"/>
</body>
</html>

0
 
SpringMVCAuthor Commented:
Yes.
And in .rc I tried:
IDI_SEC_WELCOME         BITMAP                  "welcome.bmp"
and
IDI_SEC_WELCOME         HTML                  "welcome.bmp" // because it will put the image in the same directory(inside exe file) as welcome.html
0
 
SpringMVCAuthor Commented:
Just to make sure:
first time I compiled with
IDI_SEC_WELCOME         BITMAP                  "welcome.bmp"
and second time I deleted this line and compiled with
IDI_SEC_WELCOME         HTML                  "welcome.bmp"
0
 
SpringMVCAuthor Commented:
I've found one way:
If I declare in .rc file:
IDI_SEC_WELCOME         2110                  "welcome.bmp" // IDI_SEC_WELCOME is 7011
in html I can make:
<img src="res://myexe.exe/#2110/7011" alt="Welcome"/>

and it will show an image..

But I still searching for better solution.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.