Need help using ShellExecute() 
Author Message
 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.



Tue, 03 Aug 2004 08:13:33 GMT  
 Need help using ShellExecute()
you should be including windows.h

regards,
Serge


Quote:
> 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 );
> }

> 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.



Tue, 03 Aug 2004 11:07:39 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Need help about ShellExecute!!!

2. PrintDlg when using ShellExecute

3. debugger detects memory leak after using shellexecute

4. ShellExecute fails when using SHGetSpecialFolderLocation?

5. Using ShellExecute in VC++

6. PrintDlg when using ShellExecute

7. Using shellexecute to invoke Direct:Connect (Sterling Software)

8. Memory Leaks when using Shellexecute

9. Printng Power Point documents using ShellExecute

10. Opening multiple files using ShellExecute

11. Using ShellExecute

12. Using ShellExecute() go online

 

 
Powered by phpBB® Forum Software