Jim,
>Any ideas for dynamic bind/unbind placement?
I'm not sure what you mean by this. Can you give an example?
>>
>>I'm not sure I follow your thinking with avoiding RaiseEvent() in classes.
>
>I should think that a simple method call would work just as well within any class. Am I missing something?
>
My understanding (which could very well be wrong) is that simply calling a method on a class will not cause BindEvent() to fire. Per the VFP documentation:
Visual FoxPro does not automatically raise events for custom methods that are bound to objects using BINDEVENT( ) if the methods are called directly. For example, the following code does not raise an event:oForm.GetMyData(cData)
Instead, to raise an event for a custom method, you need to make the following call:RAISEEVENT( oForm, "GetMyData", cData )
Does that clear things up?
>>I guess my most common use of it will be to report the progress of the current operation, but I'm talking business logic now. In that scenario, the event binding code would probably be in a custom form method. MyForm.DoProcess() would do something like:
>>
>>- Create business process object
>>- Open thermometer form
>>- Bind business object UpdateProgress() event to thermometer Update()
>>- Start the process on the business object
>
>Ah, but that's BINDEVENT(), not RAISEEVENT(). I see RAISEEVENT() as mainly useful to better communicate the design intention of code but otherwise acting mainly like a method call.
>
>>
>>
>SNIP