Instantiated whenever a project is opened, providing programmatic access to project events.
ProjectHook |
Remarks
A ProjectHook object is a Visual FoxPro base class that is instantiated by default whenever a project is opened. (You can include the NOPROJECTHOOK clause in CREATE PROJECT and MODIFY PROJECT to prevent a ProjectHook object from being instantiated for the project.)
The ProjectHook object allows programmatic access to events that occur in a project. For example, you can execute code whenever a file is added to a project. Note that you can specify a default project hook class for new projects in the Projects tab, of the Options dialog box or you can specify a default project hook class for an individual project in the Project Information dialog box. At runtime, you can use the ProjectHook property to specify a project hook class for a project as in the following example:
В | Copy Code |
---|---|
MODIFY PROJECT MyProject _VFP.Projects('MyProject.pjx').ProjectHook = ; NewObject('MyProjectHook', 'MyClass.vcx') |
A ProjectHook base class can be created with CREATE CLASS, CREATEOBJECT(В ), or NEWOBJECT(В ).
For more information about projects, see Project Manager Hooks.
See Also
Other Resources
ProjectHook Object Properties, Methods, and EventsCREATE CLASS Command
CREATEOBJECT( ) Function
Objects, Collections, and Classes
File Object (Visual FoxPro)
Files Collection (Visual FoxPro)
NEWOBJECT( ) Function
ProjectHook Property
Projects Collection (Visual FoxPro)
Project Object (Visual FoxPro)
Server Object
Servers Collection