Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How does Calvin's code work?
Message
From
26/02/2004 20:05:44
Joel Leach
Memorial Business Systems, Inc.
Tennessee, United States
 
 
To
26/02/2004 16:59:58
Al Doman (Online)
M3 Enterprises Inc.
North Vancouver, British Columbia, Canada
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00880866
Message ID:
00881321
Views:
88
Al,

Right. I wasn't sure what your server was written with, but a VFP MTDLL probably wouldn't work. Perhaps a C++ COM server could kick off a separate thread to run the scan in the background, return control to the calling program, then generate a callback when the scan was done. Assuming the object reference is still alive in VFP, it would be interesting to know what happens. But I don't really know much about such things, especially C++ and multi-threading.

IIRC, COM+ support started with Windows 2000. Craig Berntson wrote some articles you can find at http://www.craigberntson.com/articles.htm

>>
>>Are you saying that Server A and Server B are multi-threaded servers? If not, VFP will wait for ServerA.ScanFiles() to complete before moving on to the next instruction.
>
>I'm just starting to investigate COM in detail. At this point it looks to me like COM is basically synchronous and it's likely to take some work to make it work "asynchronously".
* MAIN.PRG
>loServerA = CREATEOBJECT("MyServer.DriveScanner")
>loServerB = CREATEOBJECT("MyServer.DriveScanner")
>
>loServerA.StartScan("C")
>
>* I believe you are correct, the following method call
>* won't start until the previous one finishes i.e. it's synchronous
>loServerB.StartScan("F")
>
>In fact, in this scenario I don't think it will make a difference if MyServer.DriveScanner is a MTDLL or not. My understanding is that a MTDLL server simply allows multiple clients to simultaneously make calls to it; if the processing time varies in length overall performance can improve because short calls are not blocked by long ones. But in either case, the calling client (MAIN.PRG) would wait until the server method call completed. In this case we have a single client to any one COM server so, as I understand it, an MTDLL server would not have any benefit.
>
>Or, were you talking about using a MTDLL something like this:
* MAIN.PRG
>loServerA = CREATEOBJECT("MyServer.DriveScanner") && MTDLL server
>loServerA.StartScan("C")
>
>* Since we still have the same client MAIN.PRG, my suspicion
>* is that the following call still won't start until the one above finishes:
>loServerA.StartScan("F")
>
>>Or do you mean do something like ServerA.StartScan(), then the server somehow returns control to the calling program while running the scan in the background? I don't know how to do that, but I would be interested in the answer to your question.
>
>That's what I'm after - asynchronous behaviour, similar to an async SPT call to a DB backend.
>
>>COM+ Queued Components might be another option.
>
>Do you have any good URLs for an overview of this? Do you know if it's supported down to W98 (and preferably, W95)?
Joel Leach
Microsoft Certified Professional
Blog: http://www.joelleach.net
Previous
Reply
Map
View

Click here to load this message in the networking platform