Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFPCOM ExportEvents
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00209137
Message ID:
00209435
Vues:
44
Now you're talking about two completely different things here...

One COM objects can expose events, and two VFP can fire internal events
(which aren't really events, just message hooks).

VFPCOM only hooks real COM events not any internal events. Furthermore
VFP COM is a COM Object itself and can work with any tool besides VFP.
You can use VFPCOM in an ASP page for example to hook event of another
object. ASP (and VBScript in general) like VFP doesn't sink events either.

VFPCOM is a pretty slick tool in that respect. It gives event sinking
capability to any COM tool that doesn't support event trapping.

+++ Rick ---



>>In another words VFP COMs dont have event interface?
>>Mark
>
>What he is saying is, if you write a VFP com server, you already have the ability to write code in the Event methods...
>
>For example... when your VFP object instanitates the Init event fires... you can, when you create that class, open the Init Event method and put code in it.
>
>But, a COM server that you didn't write will have events that fire too... previously you had no way to be informed that the event fired.
>
>For example... lets say that you are provided with a C++ COM component written by your company... In that server there was the DoorOpen event. That event fires when an employee opens a door of the building with a key card.
>
>So, you are writting a FoxPro program to log that data to a table.
>
>You write your program... you might wirte something like...
>
>oX = creatobject('Security.Doors')
>
>Ok.. so, you have a reference to the object... now, whenever a Door opens the door event fires... in VB you could write a function like...
>
>function oX_dooropen(Time as DateTime, EmployeeID as Int)
>return
>
>Well... how do you do that in VFP? You can't until NOW...
>
>So, you can write a class:
>
>********
>DEFINE DoorLogger as custom
>
>function DoorOpen
>
>blah blah
>
>endfinc
>
>enddefine
>
>************
>
>Now, after you create your reference to the comobject:
>
>oX = createobj('Security.Doors')
>oMyClass = createobj('DoorLogger')
>
>** bind the com object to your vfp class...
>
>oVFPCOM = CREATEOBJECT('vfpcom.comutil')
>
>oVFPCOM.BindEvents(oX, oMyClass )
>
>Now... whenever the DoorOpen event fires it will run your DoorOpen code in your class.
>
>COOL HUH!!!!
>
>BOb
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform