I asked a Microsoft PM about this with regard to the XSLT document()
function and using it to access a database. He said it could be done purely
in managed code (no PInvoke). I never tried it though.


Richard

> -----Original Message-----
> From: dotnet discussion [mailto:[EMAIL PROTECTED]]On Behalf Of
> David B. Bitton
> Sent: 10 May 2002 15:28
> To: [EMAIL PROTECTED]
> Subject: Re: [DOTNET] custom URL protocol handler
>
>
> As the "original poster", or as I like to call myself, Dave, perhaps a
> clarification is necessary.  The idea came from a concept that was brought
> by the Apache FOP development mailing list.  FOP is a Java package for
> rendering XSL-FO into formats such as PDF.
>
> The code allows for the XSL-FO to reference an external image
> source by way
> of a URL.  When a developer asked about how to retreive images from a DB,
> someone said that what they had done, is defined a custom URL protocol
> handler that returned the image from the DB as a byte stream, the
> same as if
> it was fetched from a HTTP server.
>
> Ok, so I am currently developing an app that parses template files, and
> outputs content based on the files.  I thought that it would be a neat
> concept if I could use custom URL's that my parser would pickup, and call
> the proper custom protocol handler.
>
> Now, I've seen from the original postings, that I need to implement two
> classes that inherit from WebRequest and WebResponse.  Where my question
> lies, is two fold.  First, does anyone have a sample if this being done?
> And second, once I have these classes, how are they known to be
> called when
> I create the WebClient() object?
>
> --
>
> David B. Bitton
> [EMAIL PROTECTED]
> www.codenoevil.com
>
> Code Made Fresh DailyT
> ----- Original Message -----
> From: "Thomas Tomiczek" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, May 10, 2002 4:02 AM
> Subject: Re: custom URL protocol handler
>
>
> I know, STILL I am not so sure what the original poster actually wants
> to achieve. And I am pretty sure he does not talk of C++ :-)
>
>
> Regards
>
> Thomas Tomiczek
> THONA Consulting Ltd.
> (Microsoft MVP C#/.NET)
>
> -----Original Message-----
> From: Valery Pryamikov [mailto:[EMAIL PROTECTED]]
> Sent: Freitag, 10. Mai 2002 09:55
> To: [EMAIL PROTECTED]
> Subject: Re: [DOTNET] custom URL protocol handler
>
> Thomas,
> IE clickable and pluggable protocol handlers are rather different
> things. With PPH you can use URL from any URLMoniker consumer, like f.e.
> source to XML Document, or URL for DirectX media surface image, and
> anything else. You control your own URL schema as you wish, and at last
> - to implement PPH isn't such a difficult job, esp. if you use helper
> classes from my web page ;-).
> As an example - vp.inlineurl protocol is only 32 lines of C++ code long
> ;-).
>
> -Valery.
>
> -----Original Message-----
> From: Thomas Tomiczek [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 10, 2002 9:46 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [DOTNET] custom URL protocol handler
>
> Valery,
>
> You define overkill by a far margin - well, it MAY be.
>
> To implement a handler for a "clickable" protocol in IE all you need is
> ONE (!) registry key to be set. Then the hyperlink click will start an
> executable with the hyperlink as parameter.
>
> The original poster asked for a class exposed, BUT - maybe he wants to
> make something like an email client, look-wise. Actually, I would have
> preferred to know more about what he wants to achieve - he wants
> something handled from within IE, and if this is as a result for a
> hyperlink (like the user clicking on a hyperlink to start an
> application), then this is easier.
>
> We use the protocol handler plus a "pickup application" that is then
> starting the real app and getting the URL by windows message.
>
> Reference:
> http://msdn.microsoft.com/workshop/networking/pluggable/overview/appendi
> x_a.asp
>
> Titled: Registering an Application to a URL Protocol
>
> In most cases this is enough :-)
>
> Regards
>
> Thomas Tomiczek
> THONA Consulting Ltd.
> (Microsoft MVP C#/.NET)
>
> -----Original Message-----
> From: Valery Pryamikov [mailto:[EMAIL PROTECTED]]
> Sent: Freitag, 10. Mai 2002 09:33
> To: [EMAIL PROTECTED]
> Subject: Re: [DOTNET] custom URL protocol handler
>
> Hi,
>         To use it from IE (and other URLMoniker consumers) you have to
> implement your own Pluggable Protocol Handler. You can find a couple of
> C++ (VC6) samples how to implement your PPH on my webpage
> http://home.online.no/~valery. Tim Tabor also has PPH sample on his
> website, which you can check.
> Clear .Net solution doesn't quite work, except if you just go interop
> way, implement all necessary PPH support+registration and register you
> .Net object as COM object. You'll also need to put it into the GAC along
> the way, for making it available for any URLMoniker consumer.
> Another way of solving it could be to implement un-managed PPH (in C++)
> and host CLR from it. It will give you many more available choices than
> going other way around. F.e. just think of the providing you own
> Evidence, or/and ApplicationBase/PrivateBinPath, ConfigurationFile and
> so fourth.
> Possibilities with the later solution is quite impressive, like f.e. you
> can use CodeDOM to dynamically compile and run embedded
> Jscript/CSharp/VB.Net code; use .Net remoting for communicating to .Net
> remote objects and/or webservices + many-many more.
> And hosting CLR is rather simple and straight-forward task - check
> "hosting interfaces.doc" in Tools Developers Guide.
>
> -Valery.
>
> -----Original Message-----
> From: David B. Bitton [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 09, 2002 11:25 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [DOTNET] custom URL protocol handler
>
> Thanks.  I checked out the link, but I'm not seeing how I would use this
> to
> create my own protocol.  For example, I'd like to be able to put in a
> URL
> "foo://bar" and have a class handle that accordingly.  Once I have
> something
> coded, how do I use it, and can I use it in IE on the local machine?
>
> --
>
> David B. Bitton
> [EMAIL PROTECTED]
> www.codenoevil.com
>
> Code Made Fresh Daily(tm)
> ----- Original Message -----
> From: "Marsh, Drew" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, May 07, 2002 1:45 PM
> Subject: Re: custom URL protocol handler
>
>
> > David B. Bitton [mailto:[EMAIL PROTECTED]] wrote:
> >
> > > Java 2 allows for the definition of custom URL protocol
> > > handlers.  By this, any entity that takes a URL as location
> > > for data, you can create a custom protocol (like cvs://), and
> > > your custom protocol handler would fetch the data.
> > >
> > > Can I do this in .NET?
> >
> > Yup, check out the System.Net.WebRequest architecture, specifically
> the
> > section called "Programming Pluggable Protocols"[1].
> >
> > HTH,
> > Drew
> >
> > [1]
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET,
> or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.
>
> You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to