Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   Send a Cancel Signal to VisBuildCmd from an app (https://www.kinook.com/Forum/showthread.php?t=1867)

onurcivi 06-28-2006 11:32 AM

Send a Cancel Signal to VisBuildCmd from an app
 
Hi,

I have a web application that allows internal users to view available build projects (all .bld files in a specific folder) and request builds. When a user requests a build, this web application invokes VisBuildCmd with the /b switch. This web application doesn't use the object model at all, it just calls the VisBuildCmd with the project name.

I would like to add the option to cancel the build to the web application and I could not find an easy way of doing this. Since I am not using the object model, the Stop method of the builder object is not available to me. Only thing that is available to me in the app is the Process Id of VisBuildCmd, and I just did not want to prematurely terminate this process from my app when a user wants to cancel the build. Is there anything I can pass to the VisBuildCmd.exe process to tell it to cancel the build, can you think of any other ways of accomplishing this?

Thank you

kinook 06-28-2006 03:09 PM

If you launch VisBuildCmd.exe via the CreateProcess [1] or related API and include the CREATE_NEW_PROCESS_GROUP flag, you could use the GenerateConsoleCtrlEvent [2] API to send it a CTRL_BREAK_EVENT. Otherwise, you would have to just terminate the process (for instance, using taskkill [3]).

[1] http://msdn.microsoft.com/library/de...ateprocess.asp
[2] http://msdn.microsoft.com/library/de...ectrlevent.asp
[3] http://www.microsoft.com/resources/d....mspx?mfr=true


All times are GMT -5. The time now is 03:20 AM.


Copyright © 1999-2023 Kinook Software, Inc.