ShellExecute(NULL,cAction[] ,cFilename[], NULL, NULL, 1);
// If ShellExecute returns an error code, let the user know.
//bool iReturn = (true || false);
return 0;
says expression expected in the shell exucute fuction on the [] of my variables. won't let me use the variables without the [] so screwed both ways
constchar cAction[5] = {"open"}; //here you have an array of c-strings
with
constchar cAction[] = "open"; //just one c-string
and remove the [] from the arguments and see how it goes.
EDIT: Actually, what error(s) does it give you when you remove the []? I compiled the above without the brackets and I don't receive any errors. The cAction initialization works as is.
ShellExecute(NULL,_T("cAction[]") ,_T("cFilename[]"), _T("cDir[]"), NULL, 1);
// If ShellExecute returns an error code, let the user know.
//bool iReturn = (true || false);
return 0;
I changed it to this but It still not working. If i don't include the variables in "" i get like some type of error. I think it this microsoft visual studio being overly picky, maybe i need to start with softer compiler or somethin. If i don't include the [] in the argument it act like c[] != c ..... if there included it says "expression expected on the closing bracket ]. The above code gives no errors but don't open the file.
Your current code doesn't open the file because you're telling windows to execute the "cAction[]" action on the file "cFilename[]" located in the directory "cDir[]".
ShellExecute(NULL,cAction[] ,cFilename[], cDir[], NULL, 1);
// If ShellExecute returns an error code, let the user know.
//bool iReturn = (true || false);
return 0;
//MessageBox ("Cannot open file. File may have been moved or deleted.", "Error!", MB_OK | MB_ICONEXCLAMATION) ;
}
returns these errors
13): warning C4129: 'D' : unrecognized character escape sequence
1>c:\users\mark\documents\visual studio 2010\projects\dick\dick\dick.cpp(19): error C2059: syntax error : ']'
1>
also says expected expression for all 3 ] in the function arguments..........
do i need different include files or somethin like that? dnt know why i can't get this right so easy on autoit
ok that actually works with no errors. But when i compile it nothing happens the file doesn't launch after i click on it that is, black window pops up for a sec an nothin happens
Did you try running with administrator privileges? Right-click your .exe and run as administrator. Or, if you're going to run it from Visual Studio, then right-click Visual Studio and run as administrator to start it.
i give up i'm goin to bed. Sad part is i just wanted to make a simple launching program to compile so i could use my decompiler an study the assembly code...... which came first the chicken or the egg?