We help IT Professionals succeed at work.

Pluggable protocal

shineway
shineway asked
on
Hi,

   I'v wrote a pluggable protocal for IE named MyPP, it can be invoked correctly by IE only if I inputted the URL in IE's address bar like 'MyPP://a.jpg', but when I wrote the URL into a html file,like this:

'<BODY>
<IMG SRC="MyPP://a.jpg"></BODY>'

and then use IE's 'File|open...' to open the html file, IE just closes itself! (my IE ver is 6.0.2600).


Is there any difference?
Comment
Watch Question

Commented:
where is your servername in this URL?
it supposed to be:

MyPP://MyServer/alias/a.jpg

Author

Commented:
Let me make it more clear.

    I wrote a Pluggable Protocal like 'MyPP://c:\temp\a.jpg' to feed back image to IE. When the URL is inputted manuly in IE's address bar, my PP just feed back the raw data of the c:\temp\a.jpg file to IE, and IE can show the image correctly. But if I used the PP in a html file, like <BODY> <IMG SRC="MyPP://c:\temp\a.jpg"></BODY>, IE will close itself! So it seems the data format of the feeding back iamge should be different.

What's the difference? Should I add some head code before returning tha raw data of the image in my pluggable protocal?
Commented:
You cannot access the resources INSIDE a webpage from your pluggable protocol handler.
Why ? coz Microsoft says so. The reason for that ? I honestly don't know. Maybe in later versions of IE.

Anyway here's an extract from MSDN (topic: Pluggable Protocols, About):

  "Also, pluggable MIME filters are only invoked by Internet Explorer for the resource specified by the URL. The MIME filter will not be invoked for other resources (such as images on an HTML page) that are associated with the resource specified by the URL."

rondi

Commented:
What you might wanna try and do is create a seperate protocol handler in an EXE. Maybe it'll behave differently - i dunno.
More from MSDN...


To enable an application to handle a particular URL protocol, you must add a new key, with the appropriate keys and values, to the registry in HKEY_CLASSES_ROOT.

The new registry key must match the protocol scheme that is being added. For instance, to add the protocol note:, the key added to HKEY_CLASSES_ROOT should be note. Under this new key, the Default string value should be the name of the new protocol, and the URLProtocol string value should contain either protocol-specific information or an empty string. Also under the new key, a DefaultIcon key and a shell key should be added. The Default string value under the DefaultIcon key must be the file name to use as an icon for this new URL protocol. Under the shell key, a key using a verb (such as open) should be added. A command key and a DDEEXEC key can be added under the key using a verb. The values under the command and DDEEXEC keys are used to call the application.

The following example shows which registry values must be added to register a new application (notepad.exe in this example) to handle a new URL protocol (note:).

[HKEY_CLASSES_ROOT]
    [note]
        (Default) = "URL:Note Protocol"
        URL Protocol = ""
        [DefaultIcon]
            (Default) = "notepad.exe"
        [shell]
            [open]
                [command]
                    (Default) = "c:\windows\notepad.exe %1"
By adding these settings to the registry, attempts to navigate to URLs such as note:c:\myfile.txt would launch Notepad to edit the file c:\myfile.txt. Of course, all the commands supported under Shell\Open are supported, including DDEEXEC (in other words, "command" is not the only key you can put under the verb).

rondi.
Asta CuTechnical consultant & graphic design
CERTIFIED EXPERT
Top Expert 2004

Commented:
Somewhat off-topic, but important.

****************************** ALERT********************************
WindowsUpdate - Critical Update alert March 28, 2002 from Microsoft
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/bulletin/ms02-015.asp
Synopsis:
Microsoft Security Bulletin MS02-015  
28 March 2002 Cumulative Patch for Internet Explorer
Originally posted: March 28, 2002
Summary
Who should read this bulletin: Customers using Microsoft® Internet Explorer
Impact of vulnerability: Two vulnerabilities, the most serious of which would allow script to run in the Local Computer Zone.
Maximum Severity Rating: Critical
Recommendation: Consumers using the affected version of IE should install the patch immediately.
Affected Software:
Microsoft Internet Explorer 5.01
Microsoft Internet Explorer 5.5
Microsoft Internet Explorer 6.0

Thought you'd appreciate knowing this.
":0)
Asta
shineway:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
CERTIFIED EXPERT

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

accept rondi's comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

geobul
EE Cleanup Volunteer

Explore More ContentExplore courses, solutions, and other research materials related to this topic.