If I don't have the loop, VFP drops through instead of waiting for the 'other' COM to complete. I don't like it either, but I can't think of a better way to handle it inside of a VFP COM.
>Hi Jeffrey,
>I don't know details of your external COM object but using endless WHILE loop to wait for completion doesn't look right to me.
>
>>I have a program which calls an external COM (DLL). The external COM has 7 events that it throws which I must trap. I defined a class (stiievents) which implements the event interface to the external COM. I then have another class that sets up the eventhandler by instantiating the stiievents class.
>>
>>When I set proc to classprog.prg which contains both class definitions, and manually step through the funcitons in the command window, it works perfectly and I can see all objects in the debugger. When I build a DLL and call the class, FoxPro hangs when the external COM triggers its first event. I also can't see the objects in the debugger because they are now external. I am baffled as to what to do next.
>
>>DEFINE CLASS homebase
>> oEvents = NEWOBJECT('stiievents')
>>
>> IF EVENTHANDLER(anobject, oEvents)
>> = anobject.amethod()
>> <b>DO WHILE !oEvents.llComplete</b>
>> ENDDO
>> = EVENTHANDLER(anobject, oEvents, .T.)
>>ENDDEFINE
>>
>>DEFINE CLASS stiievents AS Session
>> llComplete = .F.
>>
>> IMPLEMENTS _IScanningManagerEvents IN 'STIILink.ScanningManager'
>>
>> PROCEDURE _IScanningManagerEvents_OnSheetAtPrintHead(oSheetOutput AS Object)
>> This.llComplete = .T.
>> ENDPROC
>>
>> ... 6 other procedures for the other events
>>
>>ENDDEFINE
>
>>Any Ideas anyone? What's different about calling vfp classes from a procedure file versus building a DLL and calling it externally?