|
-
May 7th, 2001, 10:57 AM
#1
Thread Starter
Hyperactive Member
How to USe the Response Object from COM
Can I write to the browser directly from My COM Object ???
-
May 7th, 2001, 11:16 AM
#2
You can't really do it directly, but you can do it this way:
In your com object, you have a function or a property get, but for ease of demonstration I'll use the function example.
The com object is named Talk.dll with class module named Friendly and the function is named SayHello.
Function SayHello
SayHello = "<P align=""center""><Font color=""red""">HELLO FRIEND</Font></P>"
Exit Function
In your asp;
Set objTalk = Server.CreateObject("Talk.Friendly")
Response.Write objTalk.SayHello
-
May 7th, 2001, 11:47 AM
#3
Thread Starter
Hyperactive Member
yes well . that is the way I working now. but, I thought there might be a way to write directly to the browser.
THanks anyway
-
May 8th, 2001, 12:51 AM
#4
hi,
u can directly use the asp objects from ur component by including asp dll.
once u refer the asp dll then u just have to call the method of the component and that component will display the details on the browser.
bye
-
May 9th, 2001, 03:06 PM
#5
New Member
use it like...
In your ASP File call the function and pass the objects as parameters, like:
Dim objAPP
Set objAPP = Server.CreateObject("myProject.myClass")
objAPP.RenderPage Application, Request, Response, Server, Session
Set objAPP = Nothing
Add two References to your component using the Project|References menu: "COM+ Services Type Library" and "Microsoft Active Server Pages Object Library" (be sure to select the one from the IIS - asp.dll from system32\inetsrv directory - because is a second one from visual studio...).
Your class in your component now needs the corresponding function:
Public Sub RenderPage(objApp As ASPTypeLibrary.Application, _
objReq As ASPTypeLibrary.Request, _
objRes As ASPTypeLibrary.Response, _
objSrv As ASPTypeLibrary.Server, _
objSes As ASPTypeLibrary.Session)
objRes.Write "blablabla"
...
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|