Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. COM
  4. res: protocol and IMoniker

res: protocol and IMoniker

Scheduled Pinned Locked Moved COM
helphtml
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mstephens
    wrote on last edited by
    #1

    Has had any experience with using IMoniker to open files stored in dll's or exe's using the res: protocol. I have written code that uses CreateURLMoniker() and then IMoniker::BindToStorage() to open files and read their content via IStream. This works fine for file:, http:, ftp: protocols but fails when using the res: protocol which unfortunately is the protocol i am particularly interested in! I don't understand how IE does it since i can use CreateURLMoniker() and then pass the moniker to ShowHTMLDialog() and IE is happy to read the file. If I step through the code then my IBindStatusCallback::OnProgress() gets called with BINDSTATUS_MIMETYPEAVAILABLE and after the MIME type string 'text/html' in the szStatusText parameter is the text of the file i want to load but i don't get a good IStream* back from IMoniker::BindToStorage(). My original code used URLOpenBlockingStream() which suffers from the same problem when accessing res: resources. Please help!

    S 1 Reply Last reply
    0
    • M mstephens

      Has had any experience with using IMoniker to open files stored in dll's or exe's using the res: protocol. I have written code that uses CreateURLMoniker() and then IMoniker::BindToStorage() to open files and read their content via IStream. This works fine for file:, http:, ftp: protocols but fails when using the res: protocol which unfortunately is the protocol i am particularly interested in! I don't understand how IE does it since i can use CreateURLMoniker() and then pass the moniker to ShowHTMLDialog() and IE is happy to read the file. If I step through the code then my IBindStatusCallback::OnProgress() gets called with BINDSTATUS_MIMETYPEAVAILABLE and after the MIME type string 'text/html' in the szStatusText parameter is the text of the file i want to load but i don't get a good IStream* back from IMoniker::BindToStorage(). My original code used URLOpenBlockingStream() which suffers from the same problem when accessing res: resources. Please help!

      S Offline
      S Offline
      Stephane Rodriguez
      wrote on last edited by
      #2

      I am not sure there is a moniker for the res:// protocole. Actually, CreateURLMoniker is for http://, ftp://, and a few other. I am almost sure that CreateURLMoniker does not work with file:// for instance.


      How low can you go ?
      (MS retrof_u_ck)

      M 1 Reply Last reply
      0
      • S Stephane Rodriguez

        I am not sure there is a moniker for the res:// protocole. Actually, CreateURLMoniker is for http://, ftp://, and a few other. I am almost sure that CreateURLMoniker does not work with file:// for instance.


        How low can you go ?
        (MS retrof_u_ck)

        M Offline
        M Offline
        mstephens
        wrote on last edited by
        #3

        In my tests it works fine with the file: protocol. Thats the beauty of it, since an app can locate the resources it needs in a consistent way no matter where they are stored. Unfortunately the protocol handler for res: doesn't seem to work exactly like the others but it must be possible since you can create a IMoniker to a res: file and hand that to IE for it to load with no problems! I know that i could create my own pluggable protocol handler and that would then allow me to get at my files in resources but that seems like a lot of work when there must be slight change that i can make to the way i deal with the IMoniker interface to take advantage of Microsofts res: implementation.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups