Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel Automation
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00849132
Message ID:
00849588
Views:
31
It's not an excel issue:-)

I think what is absent is MTDLL with global variables (pier to peir server?) and an obvious COMRETURNEVENT. Why trick the client with a forced error - why not COMRETURNERROR just for errors, and an event service just for events.

Is that too simple - am I missing something?



>Terry,
>Let me see if I understand this.
>
>You have a VFP application that creates a VFP COM object. The VFP COM object has the code to bind to Excel. If there are problems with the Excel interface, you want the VFP COM object to pass information back to the VFP application.
>
>Without understanding the whys, this scenario would appear to have too much overhead. Why is the object implementing the Excel interface not being used in its VFP object form? Why does it have to be a COM object? It just seems like there is one layer too many here.
>
>Just my $0.02.
>
>As for the actual communication between VFP application and COM object, you can pass values (strings, objects, etc.) back and forth and you don't necessarily have to use COMreturnError(). I would have this function in any ERROR method to pass informatino back up the line. In this case, I see a wrapper and the wrapper communicates directly with the calling method.
>
>Regards.
>
>>Thanks for the link Larry. I am going to study that white paper.
>>
>>What does not seem obvious is how A VFP COM, implementing EventHandler(), raises an event AT the [VFP] client that instanciated it.
>>
>>It seems EventHandler's domain does not extend beyond the COM. Is there something I am missing? How is a COM event via EventHandler, communicated to it's client?
>>
>>Right now [it seems], the only way to do that is COMRETURNERROR. I nned to read - but what would be really nice would be an "ON EVENT" and a "COMRETURNEVENT". Why beat around the bush with all this "only fires inside a com that contains an OCX control"?
>>
>>>>Anybody have or know where I can get any samples regarding Excel and BindEvent()? OR, any way I can keep track of a VFP object referencing Excel.Application when the user closed Excel? Thanks,
>>>>
>>>>jfh
>>>
>>>John,
>>>BindEvent only works with VFP internal events , not COM events. For that you need to use the EventHandler function. See Calvin Hsia's artcle http://msdn.microsoft.com/library/en-us/dnfoxgen7/html/vfpandcom.asp for an example of using VFP with Excel.
>>>
>>>HTH.
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform