Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Run command and DOS window
Message
De
19/02/1999 13:36:44
 
 
À
19/02/1999 13:30:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00189351
Message ID:
00189390
Vues:
37
Thanks Ed and you were correct 'A TYPOOO', thanks a lot
I put the VCX in the form and it works wonderful...
Thanks for the other info,, I will check it out

;-)))))

thanks

Mark Oliva


>>Thanks Ed for all your help , now one more and final question
>>I added the class into my form and execute the sample code you gave me
>>but the app comes back with the following error :
>>
>>Class definition API_APRUN is not found..
>
>Looks like a typo - it's API_APPRUN. It's also not designed to be a visual class; I'd put the code in the Click() event or something on the form. Don't bother to add the class to the form; include PROCESS.VCX in your project, and then instantiate it programmatically as shown.
>
>The class works without a form, so it's easy to develop and debug your code from the VFP command box - you can debug the setup and execution interactively in the command window, and then cut and paste it into your application. The important things are to make sure that the class library can be found (it has to be included in the project somewhere, or if not included, or when working interactively, the class library needs to be somewhere in the VFP search path, so that VFP can find it when you activate the class library, and that you've made it active using SET CLASSLIB before trying to instantiate the class. You can specify the full path of a class library in CREATEOBJ/NEWOBJECT/ Add Object. Adding it to a form may be less than optimal, since the Init event expects to receive the command line, starting directory, although you can modify the properties icCommandLine, icLaunchDir and icWindowMode after instantiating it, but before using the LaunchApp or LauchAppAndWait methods. After
>instatiating the class, check the object's icErrorMessage property; it will tell you about some errors that might be encountered with a starting directory or the Window mode requested in the Init method. If you add it to a form, store the object reference in a form property or at least somewhere that it won't go away.
>>
>>Sorry for this , I am still a newbie when It comes with classess and thisr
>>sort of things
>>
>>thankss a lot
>>Mark Oliva
>>
>>>>>SET CLASSLIB TO PROCESS
>>>>>oAppTORun = CREATEOBJ('API_APPRUN',"doscommand",,'MIN') && run minimized
>>>>>oAppToRun.LaunchAppAndWait()
>>>>>oAppToRun= NULL
>>>>
>>>>thanks Ed and I Knew it I have seen this class somewhere..now
>>>>>oAppToRun.LaunchAppAndWait()
>>>>will this tell me when the application has finished executing or the DOS window
>>>>disspaear?? kind like if it is > 0 or something then the app has finished??
>>>>
>>>
>>>This will make your VFP app pause until the other application terminates. If you use the LaunchApp method instead, control will then be returned to VFP immediately. You app could then poll the termination status of the other application using the CheckProcessExitCode method; the other app will have terminated when CheckProcessExitCode returns a value other than 259.
>>>
>>>LaunchAppAndWait returns a logical; .T. means that the app ran to completion, and .F. means either that the app failed to start, or you aborted waiting on termination by pressing Escape when VFP had focus, and the program is still running. If .F. is returned, you can examine the icErrorMessage property to find out what the class thought had happened.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform