Solved

Response object in Visual Basic DLL running under MTS

Posted on 2001-06-07
3
372 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

930 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

13 Experts available now in Live!

Get 1:1 Help Now