|
13.08.2010, 21:06 | #1 |
Участник
|
sumitax: Calling external applications from User control in EP
Источник: http://sumitax.wordpress.com/2010/07...control-in-ep/
============== During EP development , sometimes we need to call third party or external applications. If you need more control over this third party call, for example you want to make sure that the application starts in an invisible mode or the process needs to be killed after a certain time. This way you can hide the window in case a success message ( 1 file successfully exported) is returned. You can do the same with using WinAPI::shellExecute from X++ and call this code from Visual Studio , but you will not find it as flexible as calling a process from Visual Studio to invoke the external application. Following is the code to call an external application : System.Diagnostics.Process my process = new System.Diagnostics.Process(); myProcess.StartInfo.Filename = "gswin32.exe"; myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden ; myProcess.StartInfo.CreateNoWindow = True myProcess.Start(); //Kill the process if it doesn’t finish in one minute. myProcess.WaitForExit(1000) ; If(!myProcess.HasExited ) { myProcess.Kill;} Источник: http://sumitax.wordpress.com/2010/07...control-in-ep/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|