Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Interrupting/Force Shutdown of Automation Server
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00414139
Message ID:
00414500
Vues:
25
>Hope someone can help, a lot of great minds out here.
>
>I have a dilemma, On a client PC, I issue a
>
>loServer = CREATEOBJECTEX("clsid","server")
>
>This creates the server ok, then I call the process to invoke. This process does specific processing looping through a primary table of "invoices" to review/analyse. On the client side, I want to trap the escape key, and if so, set a property on the loServer to flag to abort the process. Ex:
>
>on escape loServer.SetProp( "myflagproperty", .T. )
>loServer.StartProcess()
>on escape && when finished
>
>
>Problem:
>The function SetProp() works ok as I have to set other properties before calling the main process. When I try to hit the escape key, it basically ignores the ON ESCAPE call because the "loServer" process is still running. Almost like it can't interrupt the process.
>
>Does anyone have another work around? I've even thought of creating a temp file that the server side process would look for, but again, I can't interrupt the server process.
>
Don,

I'm sorry, but I don't think there is a workaround.

The problem is this: In order for user input to communicate with a program, in Windows, it has to have a UI. An in-process server can't have one. This isn't a VFP limitation, it's one imposed by Windows iteself. Everything goes through the interace's WndProc() function (keystrokes, for example). If the client application doesn't know how to respond, there's nothing it can do to shut down your server. In short, the calling application must provide some sort of interface in order to let your application know to abort. Otherwise, it can't be done.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform