Solved

Response object in Visual Basic DLL running under MTS

Posted on 2001-06-07
3
365 Views
Last Modified: 2013-11-25
Hi everyone.
I need to make a reference to response object in VB DLL running under MTS. All kind of response.write I would like to impliment in  VB DLL. Once I am done I would like to send the content of response object into the ASP page.
Any Idea.
Anu little code will be very valuable
Thank You
Nesifa
0
Comment
Question by:nesifa
3 Comments
 
LVL 1

Expert Comment

by:morgan_peat
ID: 6166998
The old way to do it was to have 2 routines:
OnStartPage()
OnEndPage()
in your VB class.

This has been superceeded (sp?) by the MTS object context.

Have a look at:
http://msdn.microsoft.com/library/periodic/period98/vb.htm
"Creating Internet Applications with Visual Basic"
0
 

Accepted Solution

by:
uschmitz earned 50 total points
ID: 6171389
Start by adding the following references to your Visual Basic ActiveX DLL project:

Microsoft Transaction Server Type Library (MTXAS.DLL)
Microsoft Active Server Pages Object Library (ASP.DLL)

Use the following code sample to access the ASP Response object within your component as an object variable called aspResponse:

    Dim aspResponse As ASPTypeLibrary.Response
    Set aspResponse = MTxAS.GetObjectContext.Item("Response")
    aspResponse.Write "Hello, world!"
    Set aspResponse = Nothing

Run the project. (You don't need to compile it to a DLL or register it with MTS.) Instantiate the object from VBScript using Server.CreateObject("Project.Class") and call the resulting object's method.

(Under Windows 2000 change the Reference to Microsoft Transaction Server Type Library [MTXAS.DLL] to COM+ Services Type Library [IASHLPR.DLL] and change "MTxAS" in the code sample to "COMSVCSLib".)

Note that the aspResponse object inside the Visual Basic component *IS* the ASP Response object. Using this technique delivers access to all the ASP Response object's properties and methods from within the VB component.

And you can even access all other ASP objects in exactly the same way.
0
 

Author Comment

by:nesifa
ID: 6183013
Very good answer
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now