
Need help using ShellExecute()
Hello,
I've been trying for a little while to get ShellExecute to work. I
think I've got close, but I have yet to succesfully compile my program
because of it. A little background, I'm using vc++ 6.0. If I use the
includes shellapi.h the compiler returns errors about that include and
doesn't compile.
All I want to do is have my program open up Internet Explorer. Here's
what I have so far as a test program to open notepad:
#include <shellapi.h>
void main()
(
HINSTANCE h = ShellExecute( NULL, "open", "Notepad.exe", NULL,
NULL, SW_MAXIMIZE );
Quote:
}
This won't compile because of problems with the shellapi.h
I've tried compiling from 2 different servers also to confirm the file
is ok
compiling...
test.cpp
e:\microsoft visual studio\vc98\include\shellapi.h(64) : error C2146:
syntax error : missing ';' before identifier 'VOID'
e:\microsoft visual studio\vc98\include\shellapi.h(64) : error C2501:
'DECLSPEC_IMPORT' : missing storage-class or type specifiers
e:\microsoft visual studio\vc98\include\shellapi.h(64) : fatal error
C1004: unexpected end of file found
Error executing cl.exe.
test.obj - 3 error(s), 0 warning(s)
Any ideas?
Can anyone include any working test codes I can try? Thanks!
Paul G.