Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ASP objects
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Titre:
Divers
Thread ID:
00354200
Message ID:
00354497
Vues:
21
>In Rick Strahl's book he discusses how to do this in his chapter on ASP. He is at www.west-wind.com. There may be a white paper you can download also.
>
>VB, since it uses early binding, can grab an object context to ASP and work directly with ASP objects inside a VB COM component. You'll probaly have to wait for VFP7 to do this in VFP.
>
>Charlie

We don't have to have early binding to get a reference to the context object, you just have to use the ProgID.

Also, we have to use the Item collection in the ContextObject instead of relying on the default property. So to get a reference to an ASP object from a VFP COM server, you can use code like this:

FUNCTION IntelligentThingToSay
oMTX = CREATEOBJECT("MTXAs.AppServer.1")
oCTX = oMTX.GetObjectContext()
oResponse = oCTX.Item("Response")
oResponse.Write("I have gum in my hair.")
ENDFUNC

It's a good idea to have a base ASP/MTS object class that you can subclass from when building COM servers for use from IIS. This class can have code that runs automatically to get a reference to the context object, and subsequently the IIS objects and store them to object properties. Then, in your business code, you can say stuff like:

THIS.Reponse.Write("My arm is caught in the toilet. Please help me.")
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform