article,shortly,want,explain,move,Output,from
Quick Search for:  in language:    
article,shortly,want,explain,move,Output,from
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
ASP/ VbScript Stats

 Code: 132,008 lines
 Jobs: 198 postings

 
Sponsored by:

 

You are in:

 
Login


 

 


Latest Code Ticker for ASP/ VbScript.
if i remember, this is a M. Harris code sample
By ask on 8/24


MTS Registration Script
By Igor Krupitsky on 8/23


Click here to see a screenshot of this code!Creating Windows Users with ASP and ADSI
By James P. Walters on 8/23

(Screen Shot)

News Poster (Advanced)
By Martin Kilbryde on 8/22


Print a web document through MS Word
By ask on 8/22


Click here to see a screenshot of this code!ADSI Domain Group Explorer
By Gordon Asbach on 8/22

(Screen Shot)

_-~Who is looking at your site? v2.0!~-_
By John on 8/22


Using HTML Option to Display Current Month
By Patrick Ingle on 8/20


FdB: Free Database (Aka Fake Database)
By TV2k.net on 8/19


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Output via ActiveX-DLL

Print
Email
 

Submitted on: 7/14/2000 7:52:32 AM
By: Bernhard "Bard" Doebler  
Level: Intermediate
User Rating: Unrated
Compatibility:ASP (Active Server Pages)

Users have accessed this article 6190 times.
 

(About the author)
 
     In this article I shortly want to explain how to move Output from Response.Write in an ASP-Script to a COM-component what my be faster. If you don't have your own webserver than you hardly have a chance to use self-developed components like this since you're in many, many cases not allowed to register your own components for security reasons. Sorry.

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
The code is relatively simple. You start Visual Basic (I thought the code does more belong in this forum than the VB forum), create a new ActiveX-DLL, name your project and the by default created class as you like and insert the following code.

Public Function Ausgeb(strAusgeb As String, rspResponse As Response) As Boolean
rspResponse.Write strAusgeb
Ausgeb = True
End Function


Public Function AusgebLn(strAusgeb As String, rspResponse As Response) As Boolean
rspResponse.Write strAusgeb & vbCrLf
AusgebLn = True
End Function

Then you save it and compile it to a DLL.
You then start Visual Interdev or your favourite ASP-editor and insert the following lines between the body-tags in script tags I at the moment don't know how to show here.
set a=Server.CreateObject
("ASPTest.ResponseTest")
a.AusgebLn "Hallo",Response
a.Ausgeb "Hallo",Response
set a=nothing

I named my project ASPTest and the Class ResponseTest. You have to change it to your project's and class' names.

You save this file in your WWWRoot or a subfolder.
After you've registered the ActiveX-DLL with Regsvr32 you can call the ASP-File via your localhost or the webserver you saved it on. If you then throw a look at the sourcecode of the output you'll see the word "Hallo" twice in two lines.
I'm sure you've guessed what the two Methods of the class do and where the differences are.

I'm at the moment not quite sure if it's faster than Response.Write but with longer text and a properly set up Transaction Server it surely can accelerate your web-applications.
Giving the Response-object by reference is much easier than finding it out using the GetObjectContext-method of a MTS-object.

If you change the Sourcecode of the DLL (e.g. if you enlarge the functionality) and get errors recompiling you have to stop the webserver, shutdown the Transaction Server and restart again. I do this using a batch file.

@echo off
NET STOP iisadmin /y
MTXSTOP
NET START W3SVC


I hope this article helpes you to understand how to develop ActiveX-DLLs for server side use.

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this article(in the Intermediate category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
7/17/2000 11:07:26 PM:Mack 10
Great job! Also, there is a great new programming site at dev-center.com. Could you please submit your code there too?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/17/2000 11:08:10 PM:Mack 10
http://www.dev-center.com
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/24/2000 3:37:35 AM:Dr.Dré
How do i use regsvr32 at the server of my provider.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/24/2000 4:35:58 AM:Bard
Hi, on Thursday August the 24th I've added the tip you with many providers can't register your own components. Thanks for taking notice of this code.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/17/2001 4:33:29 PM:Slacquer
If you were to set binary compatibility then you wouldnt have the prob with haveing to RESET your server. Do this.. Compile the DLl then make a BAK of it say MYDLL.DLL.BAK Then Use the BAK as the component for the Bianary compatibility. The reason for this is that when you compile VB will let you know if your not going to be backwards compatible. I hope this helps a bit as im a VB'r not an ASP guy (just started looking at this stuff today) What you have Explained here is nothing diffrent then say a "PLUGIN" app using another app. Its actually quite easy in C or VB But im guessing its tough with ASP?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
1/18/2001 4:07:22 AM:Bard himself
It's true, it's true. Your totally right. The component is written and compiled using VB and using binary compatibility is a good thing. I haven't tried yet but I will do. Thanks for that hint.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/13/2001 1:10:42 PM:Lewis Moten
Hmm... You could always include the scripting context rather then passing the Response Object to the subroutine. But you may run into problems with marshalling when you bring COM+ into the picture.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this article has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular article, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | ASP/ VbScript Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.