In WIN2000. Will the execution of another application in VC ++ in how to use ? Hurry ! ! !

Category: VC/MFC -> Foundation Classes Author: andy19821213 Date: 2005-08-26 13:48:04
 
andy19821213
2005-08-26 13:48:04
Prawn Good :
    I am now in a 2000 environment. In the dialog box buttons shock event. I want to call with a another application. When I used to use in the 98 's environment code is this :
STARTUPINFO   StartupInfo;
PROCESS_INFORMATION   ProcessInformation;

StartupInfo.cb   =   sizeof (STARTUPINFO) ;
StartupInfo.lpReserved   =   NULL;
StartupInfo.lpTitle   =   NULL;
StartupInfo.dwFlags   =   STARTF_USESHOWWINDOW;
StartupInfo.cbReserved2   =   0;
StartupInfo.lpReserved2   =   NULL;
StartupInfo.wShowWindow   =   SW_SHOWNORMAL;

BOOL   bReturn   =   CreateProcess (NULL, " C: \\ HiWayTel \\ Print1.exe ", NULL, NULL,
FALSE, 0, NULL, NULL, & StartupInfo, & ProcessInformation);
now to WIN2000 to die. However, the return value is a bReturn , but there is no response after I perform . I do not know who can master pointing pointing method I use something else or what could still change reality ?
jiejiejie123
2005-08-26 14:00:55
WinExec you can ! Very simple, check MSDN
li91759175
2005-08-26 14:09:39
with this.
WinExec (" C: \\ HiWayTel \\ Print1.exe ", SW_SHOW);
congxinc12
2005-08-26 14:12:12
For example :
WinExec (" c: \\ winnt \ \ system32 \\ notepad.exe, SW_SHOW ");
smashatman
2005-08-26 14:23:37
UINT   WinExec (
    LPCSTR   lpCmdLine,     //   address   of   command   line
    UINT   uCmdShow             //   window   style   for   new   application
);

WinExec (" C: \\ HiWayTel \\ Print1.exe ", SW_SHOW);
miffyxuan
2005-08-26 14:34:02
WinExec can achieve  
UINT   WinExec (
    LPCSTR   lpCmdLine,     //   address   of   command   line
    UINT   uCmdShow             //   window   style   for   new   application
);
sizhongming
2005-08-26 14:39:39
with ShellExecute
yjj19870501
2005-08-26 14:47:34
win2000 in CreateProcess need to add security attributes , win98 is not required .
cqkalai
2005-08-26 15:01:06
WinExec or ShellExecute
qqq879539313
2005-08-26 15:14:31
There are three functions :
(1) WinExec most simple, as shown above, several man ;
(2) ShellExecute directly open a file linked to the execution of the program .
(3) CreaetProcess
cqitlin
2005-08-26 15:27:04
use WinExec
UINT   WinExec (
    LPCSTR   lpCmdLine,    
    UINT   uCmdShow            
);
jebxny
2005-08-26 15:41:42
agree papaya_stone
try : CreateProcess (NULL, " C: \\ HiWayTel \\ Print1.exe ", NULL, NULL,
FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, & StartupInfo, & ProcessInformation);
junxiaozi555
2005-08-26 15:55:12
STARTUPINFO   StartupInfo   =   {0} ; // initialize
xiahky123
2005-08-26 15:58:25
can only be performed on 16 of the effective use WinExec. No effect on the 32 , I also tried using the code below :
WinExec (" C: \\ HiWayTel \\ Print1.exe ", SW_SHOW);
but runtime errors , ActiveX can not say create Object
bobo416
2005-08-26 16:07:10
with CreateProcess (NULL, " C: \\ HiWayTel \\ Print1.exe ", NULL, NULL,
FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, & StartupInfo, & ProcessInformation); and I just started that is the same or no response
blackberryda
2005-08-26 16:09:58
win2000 in the third and fourth parameter can not be null .
wolf7686868
2005-08-26 16:26:59
WinExec can perform 32 program , but I did not use it executed an application using ActiveX controls .
do not know , up
oasis1231
2005-08-26 16:43:38
Will ShellExecute How ?
qw945441154
2005-08-26 16:59:00
papaya_stone (^_^) shentong (^ _ ^)  :
          then I ask you the third and fourth arguments what values ​​should be used it?