Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: Marcia Akins
  Where is Marcia Akins?
 Akorn
 Ohio - United States
 Marcia Akins
 To: Andy at Rushcliff
  Where is Andy at Rushcliff?
 Derby
 United Kingdom
 Andy at Rushcliff
Subject: RE: Defining my own code for a COM object event
Thread ID: 103972 Message ID: 104020 # Views: 1 # Ratings: 1
Version: Visual FoxPro 9 Category: Active X Controls & OLE Automation
Date: Thursday, August 10, 2006 8:54:00 PM         
   



The class has an event called "OnDone" which is called whenever i call the "Go" method and it completes successfully.

The documentation for the "OnDone" method show a list of defined parameters which i can use.

My question is: How do i define my own code for the "OnDone" event so that i can process my own code each time the "Go" method completes successfully.


What you need to do is create a custom handler class that implement the interface of your COM component that has the OnDone method. You can then write your code in the OnDone method of your handler class.

You associate your handler class with the COM component using the EVENTHANDLER() function.

See EVENTHANDLER() and DEFINE CLASS Command - IMPLEMENTS Clause in the on-line help.

The easiest way to create your custom handler object is to open the COM object's type library in the object browser and then drag the appropriate interface into a prg. This will create a skeleon program for you that you can modify.

Regards,
Marcia G. Akins
Tightline Computers, Inc.


ENTIRE THREAD

Defining my own code for a COM object event Posted by Andy at Rushcliff @ 8/10/2006 3:12:08 PM
RE: Defining my own code for a COM object event Posted by Andy Kramek @ 8/10/2006 4:23:02 PM
RE: Defining my own code for a COM object event Posted by Andy at Rushcliff @ 8/10/2006 4:45:34 PM
RE: Defining my own code for a COM object event Posted by Bernard Bout @ 8/10/2006 5:46:21 PM
RE: Defining my own code for a COM object event Posted by Andy at Rushcliff @ 8/10/2006 5:53:51 PM
RE: Defining my own code for a COM object event Posted by Bernard Bout @ 8/11/2006 6:20:52 AM
RE: Defining my own code for a COM object event Posted by Andy Kramek @ 8/10/2006 11:09:01 PM
RE: Defining my own code for a COM object event Posted by Andy at Rushcliff @ 8/10/2006 4:48:06 PM
RE: Defining my own code for a COM object event Posted by Marcia Akins @ 8/10/2006 8:54:00 PM
RE: Defining my own code for a COM object event Posted by Andy at Rushcliff @ 8/11/2006 11:13:38 AM
RE: Defining my own code for a COM object event Posted by Marcia Akins @ 8/11/2006 12:31:40 PM