Solved

Response object in Visual Basic DLL running under MTS

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

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…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

813 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

12 Experts available now in Live!

Get 1:1 Help Now