Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: ASP aware VB DLL


Message #1 by Nigel Parker <Nigel.Parker@c...> on Wed, 12 Mar 2003 15:42:06 -0000
Hi John

Thanks for your help. This looks like a good start!

I now take a look around and try to build on this.

Thanks again.

Nigel

-----Original Message-----
From: Johnny [mailto:mailjohnny101@y...]
Sent: Thursday, March 13, 2003 7:31 PM
To: professional vb
Subject: [pro_vb] RE: ASP aware VB DLL



www.asptoday.com has some great articles on doing this.  if you dont have a
subscription, that's fine, i'm sure by now there are other resources
available.

in a nutshell, you need to have IIS installed on the dev machine to make the
"Active
Server Pages Runtime" reference available.  Once referenced, add this
routine to
your component:

'in the general declarations

'Local copies of the ASP objects
Private MainSC As ScriptingContext
Private mApplication As Application
Private mRequest As Request
Private mResponse As Response
Private mSession As Session
Private mServer As Server

Public Sub OnStartPage(PassedSC As ScriptingContext)
'this sets the scene and emulates the asp environment
    Set MainSC = PassedSC
    Set mApplication = MainSC.Application
    Set mRequest = MainSC.Request
    Set mResponse = MainSC.Response
    Set mSession = MainSC.Session
    Set mServer = MainSC.Server
End Sub

IIS will be so kind as to pass the ScriptingContext automatically to your
DLL when
you create it using the standard Server.CreateObject("YourProject.YourDll").
From
the scripting context, you can get, as noted above, all the instrinsic ASP
objects
and manipulate them as you would in an ASP page.

as a note - if you are using this DLL in an MTS/COM+ package things are a
little
different in that you must expect the ObjectContext, and not the
ScriptingContext. 
From the ObjectContext you can get the ASP objects - but i think it's done
differently.  I don't have the code for this as I have not needed it, but
i'm sure
you can find some examples in the wonderful internet world.

Enjoy.

john

----------------------
John Pirkey
MCSD (VB6)
http://www.stlvbug.org

--- Mike of Tosa <mike8845@w...> wrote:
> Try referencing the Wrox publications.  their web site is wrox.com
> 
> Mike
> 
> -----Original Message-----
> From: Nigel Parker [mailto:Nigel.Parker@c...]
> Sent: Wednesday, March 12, 2003 9:42 AM
> To: professional vb
> Subject: [pro_vb] ASP aware VB DLL
> 
> 
> Hi All,
>  
> I would like to write an ASP aware DLL in VB6.
> Specifically to work with the request/response objects.
>  
> can anyone give me any help into where I could get any info into how to go
> about this?
> I intend to create / call this component from an ASP page or pages.
>  
> Any pointers will be a great help I'm sure!
> 
> Regards,
> 
> Nigel
> 
>   
> 
>  
> 
> 
> 
> 
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com


  Return to Index