PDA

View Full Version : LaunchAppAndWait function return code "Incorrect function"



gmpk82
08-30-2013, 01:12 PM
hi,

I am trying to execute one command using LaunchAppAndWait , it does not do anything and getting return as "Incorrect function". what is the meaning of "Incorrect function", how to resolve this issue

help me. much appreciated

thanks
gmpk

Roman1
08-31-2013, 12:35 AM
Please put some test project, to investigate this issue.

gmpk82
08-31-2013, 02:06 PM
hi Roman1 , thanks for quick reply I’m using below code,it is returning "Incorrect function" error.



szCmd = "\"" + INSTALLDIR + "abc\\xyz\\myconfig.exe\" –lb -pxd es@Lblblb-1 reset –ssv";

MessageBox ("szCmd " + szCmd, INFORMATION);

nRes = LaunchAppAndWait ( szCmd, "", LAAW_OPTION_WAIT | LAAW_OPTION_HIDDEN );
nReturnCode = NULL;
nReturnCode = LAAW_PARAMETERS.nLaunchResult;

if ( nReturnCode != 0 )then
MessageBox ("command execution failed " + FormatMessage(nReturnCode), INFORMATION);
else
MessageBox ("command execution succeeded " + FormatMessage(nReturnCode), INFORMATION);
endif;

Roman1
08-31-2013, 03:30 PM
Try to separate command and param part of your extern function call.
Please try to call your exe app without param part firstly.

gmpk82
10-02-2013, 10:51 AM
it is code issue, I did not pass parameters properly.

thanks all for your time.