shellexecute, grrr...

OK, I'm a newb. I realize that, but I still don't see why this shouldn't open the file in shellexecute. It tells me that shellexecute is an unresolved external symbol but shouldn't including windows.h fix that?

#include <stdio.h> // C library to perform Input/Output operations
#include <tchar.h>
#include <stddef.h> // C Standard definitions
#include <iostream> // Input/Output
#include <fstream>
#include <cstdlib>
#include <windows.h>

int main()
{
ShellExecute(NULL, "open", "S:/storm.exe", NULL, NULL, SW_HIDE);
system ("Pause");
return 0;
}

There is a few more lines (dialoge that wil eventually direct the user) but this is what won't work. Any ideas?
unresolved external symbol but shouldn't including windows.h fix that?


No. What will fix an unresolved external is linking against the library that contains it.
You need to include shellapi.h and link with shell32.lib in this case.
Thanks, that fixed it.
Topic archived. No new replies allowed.