Opening File Through C++
-
Does anyone know the command for executing a file through c++(MFC) (Opening the file with the assoicated program) I tried looking up execute or searching in the help but I'm not finding it.... Can anyone point me in the right direction?
see CreateProcess, WinExec and spawn. or see "system" if you want to launch from a shell. -c
Image tools: ThumbNailer, Bobber, TIFFAssembler
-
Does anyone know the command for executing a file through c++(MFC) (Opening the file with the assoicated program) I tried looking up execute or searching in the help but I'm not finding it.... Can anyone point me in the right direction?
Take a look at ShellExecute(). Dave http://www.cloudsofheaven.org
-
Does anyone know the command for executing a file through c++(MFC) (Opening the file with the assoicated program) I tried looking up execute or searching in the help but I'm not finding it.... Can anyone point me in the right direction?
-
Does anyone know the command for executing a file through c++(MFC) (Opening the file with the assoicated program) I tried looking up execute or searching in the help but I'm not finding it.... Can anyone point me in the right direction?
Try this one - for starting the executable associated with file and wait until the exec. is finished.
SHELLEXECUTEINFO si; memset( &si, 0, sizeof(si) ); si.cbSize = sizeof( SHELLEXECUTEINFO ); si.fMask = SEE_MASK_NOCLOSEPROCESS; si.lpFile = szFileName; BOOL bRet = ShellExecuteEx( &si ); if( bRet && si.hProcess ) { // wait for process to end, process handle is stored in si.hProcess }
hope this helps