'These are the API declarations
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function TerminateProcess& Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long)
Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Const PROCESS_TERMINATE = &H1
Private Const PROCESS_QUERY_INFORMATION = &H400
Private Const STILL_ACTIVE = &H103

'Stick this in general declarations so the code
'in your cancel button can also see it
Dim ProcID As Long


'This can go in your cancel button
Dim hProc As Long
hProc = OpenProcess(PROCESS_TERMINATE, 0, ProcID)
TerminateProcess hProc, 0
CloseHandle hProc


'The rest of this can be used to start your c++ app
Dim hProc As Long
Dim ProcStatus As Long

'Substitute notepad for your c++ app
ProcID = Shell("notepad.exe", vbNormalFocus)
'Get a handle to the process
hProc = OpenProcess(PROCESS_QUERY_INFORMATION, 0, ProcID)
Do
'Allow other things to happen in your app, such as Cancel being pressed
DoEvents
'Get the status of the other app
GetExitCodeProcess hProc, ProcStatus
Loop While ProcStatus = STILL_ACTIVE
'Close the handle, we're done with it
CloseHandle hProc

'Put any code here that is supposed to execute when the other app stops running
MsgBox "It's done."