Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COM Server problem
Message
From
28/01/1999 11:47:46
 
 
To
28/01/1999 11:08:46
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00181348
Message ID:
00181375
Views:
17
>I have created a COM object (called exporter) which includes an export method. This method can take several mins to run.
>
>Say a client program does this:
>ox = CREATEOBJECT("exporter")
>ox.Export()
>The client has to wait until the export method finishes.
>
>Instead I put a timer into my COM object (which is based on a Form class). The Export method just enables the timer and ends. When the timer fires it runs the 'real' method (now called do_export).
>This gives me asynchronous control and works really well. If the client wants to check progress in the COM object it has properties such as PercentDone and Busy etc.
>
>The bad news - the error handling fails if a timer is used. Instead of my Error method kicking in with my COMReturnError message I get:
>Fatal error: Exception code=C00000FD every time.
>
>If I call my method directly - error handling is as advertised - indirect it via a timer - Fatal Error.
>
>Any suggestions - or alternative approaches to the problem?

You're running into threading issues, and with the current version of VFP, and blocking COM interfaces, I'm afraid there won't be an easy fix until MS fixes the apartment threading and COM issues in VFP6.

If you're running your server in-process, you might be able to use MTS to host your object; it'd be running out-of-process that way, and MTS would manage the OLE interface for you. I haven't tried this, so it's a guess at best. Another approach would be to compile it as an out-of-process server (.EXE), but there's still some interaction between VFP sessions.

You certainly could try running out-of-process remotely; that way, there's no direct interaction possible between the application's VFP environment and the VFP environment on the remote server.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform