FIX: RES Protocol with Custom Resource Only Works on Windows NT
ID: Q237769
|
The information in this article applies to:
-
Microsoft Internet Explorer (Programming) versions 4.0, 4.01, 4.01 SP1, 4.01 SP2, 5
SYMPTOMS
RES protocol URLs may work correctly on Windows NT but fail to retrieve the specified resource on systems running Windows 95 or Windows 98.
CAUSE
All versions of Internet Explorer 4 on Windows 95 and Windows 98 are unable to retrieve any resources that aren't stored in the resource section as the default resource type, RT_HTML.
RESOLUTION
To resolved this problem, use one of the following methods:
- Upgrade Windows 95 or Windows 98 clients to Internet Explorer 5.
- Store the custom resources using the HTML resource type and use the short form of the RES protocol URL.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed
at the beginning of this article.
This bug was corrected in Internet Explorer version 5 for Windows.
MORE INFORMATION
Steps to Reproduce Behavior
- Create a simple resource DLL named Resprot98.dll that adds four images into the resource using the following .rc file fragment:
/////////////////////////////////////////////////////////////////////////////
//
// HTML
//
banana.gif HTML DISCARDABLE "banana.gif"
/////////////////////////////////////////////////////////////////////////////
//
// GIFS
//
orange.gif GIFS DISCARDABLE "orange.gif"
IDR_PEAR GIFS DISCARDABLE "pear.gif"
/////////////////////////////////////////////////////////////////////////////
//
// JPGS
//
apple.jpg JPGS DISCARDABLE "apple.jpg"
Each of the four images are brought in by a resource script import line specifying a user-defined resource. On each line, the parameters are separated by white space. The first parameter on each line is the resource identifier string that will be used to identify the item in the resource section.
In this specific example, IDR_PEAR is defined in Resource.h as 104:
#define IDR_PEAR 104
The other three resource names are just treated as character strings.
The second parameter on these lines is the resource type. The resource type "HTML" is RT_HTML, predefined as the resource type "23". This is the default resource type for the RES protocol.
The other two resource types used in this example (GIFS and JPGS) are just custom resource types identified by those specific strings.
The third parameter is an attribute modifier of the resource. DISCARDABLE is used for legacy reasons.
The last parameter specifies the file to be imported into the resource section.
- Copy the resource DLL with these resources to the location "C:\Temp\Resprot98.dll"
- Use an HTML page, such as the following, that attempts to use the images from the DLL using the RES protocol:
<HTML><HEAD><TITLE>Simple tests of RES: protocol</TITLE></HEAD><BODY>
This works:
<IMG SRC="res://C:\temp\resprot98.dll/banana.gif" ALT="res://C:\temp\resprot98.dll/banana.gif"><BR/>
<HR>
These fail:
<IMG SRC="res://C:\temp\resprot98.dll/GIFS/orange.gif" ALT="res://C:\temp\resprot98.dll/GIFS/orange.gif">
<IMG SRC="res://C:\temp\resprot98.dll/JPGS/apple.jpg" ALT="res://C:\temp\resprot98.dll/JPGS/apple.jpg">
<IMG SRC="res://C:\temp\resprot98.dll/GIFS/#104" ALT="res://C:\temp\resprot98.dll/GIFS/#104">
<IMG SRC="res://C:\temp\resprot98.dll/#23/banana.gif" ALT="res://C:\temp\resprot98.dll/#23/banana.gif">
<IMG SRC="res://C:\temp\resprot98.dll/23/banana.gif" ALT="res://C:\temp\resprot98.dll/23/banana.gif">
</BODY></HTML>
All five URLs are valid uses of the RES protocol. When the test page is viewed in Internet Explorer 4 on Windows NT, all images are retrieved successfully. However, only the first RES URL works on Windows 95 and Windows 98.
© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Jason Strayer, Microsoft Corporation
Additional query words:
Keywords : kbIE400bug kbIE401bug kbNavigation kbIE401sp1bug kbIE401sp2bug kbURLMon kbGrpInet kbIE500fix kbDSupport
Version : WINDOWS:4.0,4.01,4.01 SP1,4.01 SP2,5
Platform : WINDOWS
Issue type : kbbug