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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. On the res:// protocol

On the res:// protocol

Scheduled Pinned Locked Moved C / C++ / MFC
htmltutorialquestionlearning
8 Posts 3 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.
  • S Offline
    S Offline
    soup
    wrote on last edited by
    #1

    Hi, I am creating an app that integrates the CHtmlView. On certain occasions, I would like to load a HTML file (or images) from a resource dll, so that all the files are kept together, cannot be deleted or edited etc. Has anyone succeeded in creating a DLL with resources in it used by Internet Explorer and the res:// protocol? If so, could it be explained how, or does anyone have *decent* links to: 1. how to create a resource dll 2. how to make resources accessible from it to IE and the res:// protocol Thanks in advance, Simon :confused: PS: I have seen the (very) few MSDN articles, that have left me suitably high and dry.

    M M 2 Replies Last reply
    0
    • S soup

      Hi, I am creating an app that integrates the CHtmlView. On certain occasions, I would like to load a HTML file (or images) from a resource dll, so that all the files are kept together, cannot be deleted or edited etc. Has anyone succeeded in creating a DLL with resources in it used by Internet Explorer and the res:// protocol? If so, could it be explained how, or does anyone have *decent* links to: 1. how to create a resource dll 2. how to make resources accessible from it to IE and the res:// protocol Thanks in advance, Simon :confused: PS: I have seen the (very) few MSDN articles, that have left me suitably high and dry.

      M Offline
      M Offline
      Matt Newman
      wrote on last edited by
      #2

      Do you mean res://yourdll.dll/yourpage.html ? -:suss:Matt Newman / Anti-Linux Activist:suss: -Sonork ID: 100.11179:BestSnowman
      †

      S 1 Reply Last reply
      0
      • S soup

        Hi, I am creating an app that integrates the CHtmlView. On certain occasions, I would like to load a HTML file (or images) from a resource dll, so that all the files are kept together, cannot be deleted or edited etc. Has anyone succeeded in creating a DLL with resources in it used by Internet Explorer and the res:// protocol? If so, could it be explained how, or does anyone have *decent* links to: 1. how to create a resource dll 2. how to make resources accessible from it to IE and the res:// protocol Thanks in advance, Simon :confused: PS: I have seen the (very) few MSDN articles, that have left me suitably high and dry.

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        Create an HTML resource in your module (can be an EXE or DLL) with a string ID (not an integer ID) and reference it like: res://C:\path\to\your\file.dll/YOURPAGEID.html --Mike-- Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines! My really out-of-date homepage Big fan of Alyson Hannigan and Jamie Salé.

        S 1 Reply Last reply
        0
        • M Matt Newman

          Do you mean res://yourdll.dll/yourpage.html ? -:suss:Matt Newman / Anti-Linux Activist:suss: -Sonork ID: 100.11179:BestSnowman
          †

          S Offline
          S Offline
          soup
          wrote on last edited by
          #4

          Yup, that's exactly what I am after. I created a Win32 Dynamic-Link Library project (empty) and ripped all the code link settings out, then added a resource file. To that I added a HTML resource, with the resource identifier IDR_HOME. This resulted in the following line being in my resource file when viewed as text: IDR_HOME HTML DISCARDABLE "home.htm" Also, a home.htm file gets created in my project folder, so I put in some source and then build it. Then typing in the actual path (given here for completeness): res://C:\Program Files\Microsoft Visual Studio\VC98\MyProjects\HtmlRes\reslocal\Debug\reslocal.dll/home.htm simply results in the 'Page Cannot be Displayed' IE error from it's own shdocl.dll thingy. Anything obvious I am doing wrong here? Thanks, Simon

          M 1 Reply Last reply
          0
          • S soup

            Yup, that's exactly what I am after. I created a Win32 Dynamic-Link Library project (empty) and ripped all the code link settings out, then added a resource file. To that I added a HTML resource, with the resource identifier IDR_HOME. This resulted in the following line being in my resource file when viewed as text: IDR_HOME HTML DISCARDABLE "home.htm" Also, a home.htm file gets created in my project folder, so I put in some source and then build it. Then typing in the actual path (given here for completeness): res://C:\Program Files\Microsoft Visual Studio\VC98\MyProjects\HtmlRes\reslocal\Debug\reslocal.dll/home.htm simply results in the 'Page Cannot be Displayed' IE error from it's own shdocl.dll thingy. Anything obvious I am doing wrong here? Thanks, Simon

            M Offline
            M Offline
            Matt Newman
            wrote on last edited by
            #5

            Make the resource ID "HOME.HTM" with quotes, then red://reslocal.dll/home.htm will work. -:suss:Matt Newman / Anti-Linux Activist:suss: -Sonork ID: 100.11179:BestSnowman
            †

            S 1 Reply Last reply
            0
            • M Matt Newman

              Make the resource ID "HOME.HTM" with quotes, then red://reslocal.dll/home.htm will work. -:suss:Matt Newman / Anti-Linux Activist:suss: -Sonork ID: 100.11179:BestSnowman
              †

              S Offline
              S Offline
              soup
              wrote on last edited by
              #6

              Absolutely stunning! Cheers so much Matt. I wasn't far away (well I was), I had it working with the resource identifier bit: blah-blah/%23101 The quotes has just made it all look so much more friendly when the source if viewed etc. Thanks again, Simon

              M 1 Reply Last reply
              0
              • M Michael Dunn

                Create an HTML resource in your module (can be an EXE or DLL) with a string ID (not an integer ID) and reference it like: res://C:\path\to\your\file.dll/YOURPAGEID.html --Mike-- Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines! My really out-of-date homepage Big fan of Alyson Hannigan and Jamie Salé.

                S Offline
                S Offline
                soup
                wrote on last edited by
                #7

                Thanks for the pointer Michael. It seems obvious know that a string id is one with " around it, but that don't look right in the IDE, so I was having trouble with that in the end. All working now though. :-D Thanks, Simon

                1 Reply Last reply
                0
                • S soup

                  Absolutely stunning! Cheers so much Matt. I wasn't far away (well I was), I had it working with the resource identifier bit: blah-blah/%23101 The quotes has just made it all look so much more friendly when the source if viewed etc. Thanks again, Simon

                  M Offline
                  M Offline
                  Matt Newman
                  wrote on last edited by
                  #8

                  No problem. It was a simple problem with an answer someone would never think of :) -:suss:Matt Newman / Anti-Linux Activist:suss: -Sonork ID: 100.11179:BestSnowman
                  †

                  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