I am trying to launch a program from a button and when I introduced the ShellExecuteEx code, I began to have a bunch of problems. I've since resolved all of them but one.
Your if(ShellExecuteEx(&ExecuteInfo) == FALSE) lack a { but have a closing }
That ); will probaly cause some trouble as well
Last edited by S_M_A; January 23rd, 2009 at 05:28 PM.
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it.
- Brian W. Kernighan
I thought that the opening and closing brackets at lines 132 and 149 applied for
Code:
if(ShellExecuteEx(&ExecuteInfo) == FALSE)
I got 2 more errors when I added the opening bracket
Code:
{
if(ShellExecuteEx(&ExecuteInfo) == FALSE)
// Could not start application -> call 'GetLastError()'
}
Errors:
(6) : error C2143: syntax error : missing ';' before 'using'
(150) : error C2143: syntax error : missing ';' before '}'
19) : fatal error C1075: end of file found before the left brace '{'
So then I added another closing bracket on line 146 so it too had a closing bracket
It then went down to two errors:
(147) : error C2059: syntax error : '{'
(147) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
Wrong forum. As far as this forum is concerned, that "^" is the exclusive-or operator in C++, and that line of code makes no sense whatsoever.
That code is managed C++, and this is not a managed C++ forum. This forum is explicitly for non-managed, traditional C++ using Visual C++ using MFC, ATL, COM, etc.
So, then do I wait for a Mod to take it over to the other section, or open up a new thread there?
Usually the moderators pick up the thread and move it to the appropriate forum. If it isn't moved, then maybe you can alert one of them to the thread to have it moved.
Bookmarks