Sub_Main
asked on
eqvivalent for VB "Shell Function"
i'm VB.
i'm looking for MFC\VC++ eqvivalent for VB Shell Function.
this function activates any application from the current code.
examples :
Shell "path To App EXE",windowMode(Constants available)
or :
Shell "pathToDocFile_pathToWinwo rd",Window Mode
etc...
knowing no eqvivalent in MFC\VC++, i've tried to include the
Proccess.H lib, and used :
system("ApplicationPath");
that's works fine only when the path is in the same dir :
system("abc.exe");
system("abc.msi");
this one is not executing (the path is correct) :
system("I:\Program Files\Project1\Project1.ex e");
this line raise 3 warnings :
warning C4129: 'P' : unrecognized character escape sequence
i suspect it's the Slash or space in folder name or long folder name.
another thing i've tried is a batch file. that's fine exept that it don't get a folder name like "Program Files"
anyway, i need an MFC\VC++ solution as simple as VB....
thank you.
i'm looking for MFC\VC++ eqvivalent for VB Shell Function.
this function activates any application from the current code.
examples :
Shell "path To App EXE",windowMode(Constants available)
or :
Shell "pathToDocFile_pathToWinwo
etc...
knowing no eqvivalent in MFC\VC++, i've tried to include the
Proccess.H lib, and used :
system("ApplicationPath");
that's works fine only when the path is in the same dir :
system("abc.exe");
system("abc.msi");
this one is not executing (the path is correct) :
system("I:\Program Files\Project1\Project1.ex
this line raise 3 warnings :
warning C4129: 'P' : unrecognized character escape sequence
i suspect it's the Slash or space in folder name or long folder name.
another thing i've tried is a batch file. that's fine exept that it don't get a folder name like "Program Files"
anyway, i need an MFC\VC++ solution as simple as VB....
thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
::ShellExecute(hWnd, NULL, _T("c:\\dirname\\abc.exe") , NULL, NULL, SW_SHOWNORMAL);
ASKER
does compiling it with MFC lib linked - will make the EXE run on any machine without instllation ?
i mean, in VB - if you just create an empty project - you have to install all VB runtime DLLs on the target machine.
i want to use MFC in order to distribute only the EXE by copying it.
will it work under any 95\98\NT clean fresh machine ?
i mean, in VB - if you just create an empty project - you have to install all VB runtime DLLs on the target machine.
i want to use MFC in order to distribute only the EXE by copying it.
will it work under any 95\98\NT clean fresh machine ?
ShellExecute is a Win32 API function, meaning that it is available on any Windows 95, 98 and NT. Actually, even Windows 3.1 supports it.
ASKER
tnx
system("I:\\Program Files\\Project1\\Project1.