Results 1 to 5 of 5

Thread: How to USe the Response Object from COM

  1. #1

    Thread Starter
    Hyperactive Member razzaj's Avatar
    Join Date
    Oct 1999
    Location
    jounieh
    Posts
    261

    How to USe the Response Object from COM

    Can I write to the browser directly from My COM Object ???
    - regards -
    - razzaj -

  2. #2
    bubba
    Guest
    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

  3. #3

    Thread Starter
    Hyperactive Member razzaj's Avatar
    Join Date
    Oct 1999
    Location
    jounieh
    Posts
    261
    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
    - regards -
    - razzaj -

  4. #4
    Mustufa
    Guest

    Smile

    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

  5. #5
    New Member
    Join Date
    May 2001
    Posts
    1

    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
  •  



Click Here to Expand Forum to Full Width