ShellExecute

I have tried for days to execute a program using ShellExecute but just cannot seem to get it to work. I am compiling with VS2010 and here is the code:

1
2
3
4
5
6
7
8
9
#include <iostream>
#include <shellapi.h>

using namespace std;

int main()
{
 ShellExecute(NULL, "open", "IQConnect.exe", NULL, NULL, SW_SHOWNORMAL);
}


Thanks for any help you can offer.
it works fine but have you tried the full path?

ShellExecute(NULL, "open", "c:\\1.exe", NULL, NULL, SW_SHOW);
Topic archived. No new replies allowed.