Access to ASP objects from VB6 dll
Posted on 2003-02-23
I'm adding a dll created with VB6 to my ASP application and need to access the Active Server Page intrinsic objects 'Application' and 'Session' from within the dll. I want my ASP application to be compatible with everything from PWS running on Windows 95 to IIS 5 running on Windows 2000 and so far it is. My development environment is Windows 2000 Pro.
I'm concerned that creating the dll with a reference to either MTS or COM+ will make my application incompatible with some web server installations because I know from experience that PWS and IIS are often installed without MTS. However, I keep reading that using ASPTypeLibrary.ScriptingContext in an OnStartPage event to get the Object Context is not a good thing.
Also, some references state that the OnStartPage event is triggered at the beginning of the ASP but other references state that it is triggered when the component is created from within the ASP script.
I want to keep the application simple to install and certainly don't want to force the installer to understand how to create MTS packages, etc.
1. Is using ASPTypeLibrary.ScriptingContext in an OnStartPage event to get the Object Context really a bad idea?
2. Exactly when is the OnStartPage event triggered?
3. If I reference MTS or COM+ does the dll have to be registered in MTS to function. Also, if I compile the dll on Windows 2000 using COM+ would it work on another OS like NT4 or Windows 95?