title: How to emulate the ScriptingContext's "ASPTypeLibrary.Application" Object
body: <p>I have been tasked with modifying some legacy ActiveX DLLs written in Visual Basic 6. One of the things I need to do is to emulate the "ScriptingContext" object, (so that we can support other mechanisms for running the DLLs other than IIS without having to re-write large chunks of the code).</p>
  
  <p>Something that has been causing me some grief is the "ASPTypeLibrary.Application" object which has two very different ways to access its stored values, eg:</p>
  
  <pre><code> .Application("KeyName")
  </code></pre>
  
  <p>or</p>
  
  <pre><code> .Application.Value("KeyName")
  </code></pre>
  
  <p>How can I create my own VB6 class which supports both of these access mechanisms? I can do one or the other but not both?</p>
  
  <p>(a simple code example would be great thanks, I'm not a VB6 programmer)</p>