ShellExecuteWait()

While using the ShellExecuteWait ( "MegaMoney.exe" [, " " [, " " [, "open" [, showflag]]]] ) function, I know that the *showflag* is optional, but what do you put in it if you want to leave it blank? Will " " be acceptable?
This is a C++ forum, not an AutoIT forum. In C/C++ we use CreateProcess() or ShellExecuteEx() and then WaitForSingleObject() handle.
c++ coding is what I'm asking about. I'm having coding problem with ShellExecuteWait() function. Please ignore the goto--it is temporary-- My code is:
1
2
3
4
5
6
7
8
9
10
11
12
if (z == 1)
		{
			//using namespace std;
			cout << "You have chosen to play Florida's Lottery, " << endl << endl;
			cout << " Please wait while I load the file." << endl << endl;
			ShellExecuteWait ( "place_8.exe" [, " " [, " " [, "open" [, " "]]]] );
			//cout << " You have pressed #1 " << endl << endl;
			goto Start;
			//exit;
			//goto FlaLottery;
			
		}

I'm getting:
1
2
3
4
5
6
7
8
9
1
1>Build started 5/13/2012 11:52:48 AM.
1>InitializeBuildStatus:
1>  Touching "x64\Debug\Therry_Lottery.unsuccessfulbuild".
1>ClCompile:
1>  Therry_Lottery.cpp
1>Therry_Lottery.cpp(51): error C2059: syntax error : ','
1>Therry_Lottery.cpp(61): fatal error C1903: unable to recover from previous error(s); stopping compilation
1>
1>Build FAILED.

I've never used the ShellExecuteWait() function before. I don't know what I did wrong. How can I fix this error?. . . .Thanks!
The [ ] thing shouldn't be put into the code. It just a way of writing meaning that what's inside is optional.
ShellExecuteWait("MegaMoney.exe" , "", "", "open")
Last edited on
Thanks Peter87, I've made the changes, but now I have a new set of problems. My new code is:
1
2
3
4
5
6
7
8
9
10
11
12
13

		if (z == 1)
		{
			//using namespace std;
			cout << "You have chosen to play Florida's Lottery, " << endl << endl;
			cout << " Please wait while I load the file." << endl << endl;
			ShellExecuteWait ( "place_8.exe" , " " , " " , "open" );
			//cout << " You have pressed #1 " << endl << endl;
			goto Start;
			//exit;
			//goto FlaLottery;
			
		}

and I get:
1
2
3
4
5
6
7
8
9
10
1
1>Build started 5/13/2012 1:19:11 PM.
1>InitializeBuildStatus:
1>  Touching "Debug\Therry_Lottery.unsuccessfulbuild".
1>ClCompile:
1>  Therry_Lottery.cpp
1>c:\tmci\therry_lottery\therry_lottery.cpp(51): error C3861: 'ShellExecuteWait': identifier not found
1>c:\tmci\therry_lottery\therry_lottery.cpp(92): warning C4390: ';' : empty controlled statement found; is this the intent?
1>c:\tmci\therry_lottery\therry_lottery.cpp(97): warning C4551: function call missing argument list
1>
1>Build FAILED.

How can I fix this? . . . . thanks!
I don't know anything about AutoIT. Are you sure this is a C++ function? Did you include a header file that declares ShellExecuteWait?
I googled that function and all it comes out is AutoIT. I think the guy has a big confusion.
Interestingly googling ShellExecuteWait and c++, top result: this post.
webJose wrote:

I think the guy has a big confusion

Me too.
Topic archived. No new replies allowed.