Solved

Response object in Visual Basic DLL running under MTS

Posted on 2001-06-07
3
387 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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 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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

688 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