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#
  4. MIME filter

MIME filter

Scheduled Pinned Locked Moved C#
csharpquestionlearning
3 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.
  • B Offline
    B Offline
    Bog
    wrote on last edited by
    #1

    Hello, has anyone ever created a MIME filter before (c# or otherwise)? I tried to make a mime filter for a content-type that I invented: "text/myml", and when I test it, my filter's Start() method get's called, but then nothing else happens. The behavior in the browser is that it just hangs until I click the stop button. Although, when I click the stop button, IE calls my mime filter's Abort and Terminate methods. Is there something special my MIME filter has to do in the Start method? All I have it doing right now is store m_Sink and m_pIncomingProt. Also when Start() is called, dwReserved.pProtocol comes in null. I don't know why but that seems like a bad thing? "Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read." -Groucho Marx

    A 1 Reply Last reply
    0
    • B Bog

      Hello, has anyone ever created a MIME filter before (c# or otherwise)? I tried to make a mime filter for a content-type that I invented: "text/myml", and when I test it, my filter's Start() method get's called, but then nothing else happens. The behavior in the browser is that it just hangs until I click the stop button. Although, when I click the stop button, IE calls my mime filter's Abort and Terminate methods. Is there something special my MIME filter has to do in the Start method? All I have it doing right now is store m_Sink and m_pIncomingProt. Also when Start() is called, dwReserved.pProtocol comes in null. I don't know why but that seems like a bad thing? "Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read." -Groucho Marx

      A Offline
      A Offline
      Arun Bhalla
      wrote on last edited by
      #2

      Do you have documentation source for this? I need to do something similar, and I assumed that it would require writing a COM server... Arun

      H 1 Reply Last reply
      0
      • A Arun Bhalla

        Do you have documentation source for this? I need to do something similar, and I assumed that it would require writing a COM server... Arun

        H Offline
        H Offline
        Heath Stewart
        wrote on last edited by
        #3

        It does, and I haven't had much success doing so. You need to look into the IInternetProtocol interface and its related interface. You basically have to recreate a lot of that functionality in .NET. By the time you're done, you may as well have done it in C++ because of the amount of work. I was working on a library for it (abstract class and stuff like that), but there's a lot of hang-ups because interface methods don't always interop using 1-to-1 parameter mapping. For instance, the IClassFactory.CreateInstance method is only supposed to take 2 methods (while the return type is still void) instead of 3. Just weird stuff like that. If you want, you could create forward declarations of these in an IDL file, compile the IDL file using the MIDL compiler, then generate an interop assembly using tlbimp.exe. It works to generate the interfaces, structs, and enums, but it's very messy and doesn't always provide what you need. For instance, it always creates methods that return void, when some of those protocol methods must return an HRESULT (int or uint is good in .NET) in order to work correctly, since different return values tell the client to do different things. This becomes a big problem when generating the interop assembly automatically.

        -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

        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