Microsoft KB Archive/237769

= FIX: RES Protocol with Custom Resource Only Works on Windows NT =

Article ID: 237769

Article Last Modified on 10/16/2002

-

APPLIES TO


 * Microsoft Internet Explorer 4.0 128-Bit Edition
 * Microsoft Internet Explorer 4.01 Service Pack 2
 * Microsoft Internet Explorer 4.01 Service Pack 1
 * Microsoft Internet Explorer 4.01 Service Pack 2
 * Microsoft Internet Explorer 5.0

-



This article was previously published under Q237769



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 resolve 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 that this is a problem in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Internet Explorer version 5 for Windows.



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:

The other three resource names are just treated as character strings.
 * 1) define IDR_PEAR   104

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: Simple tests of RES: protocol</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> </li></ol>

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.

Keywords: kbbug kbfix kbnavigation kburlmon kbie500fix KB237769

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.