ShellexEcute
-
Hello peepz
I talk in English cus i'm dutch so please don't watch my spelling.Ok the problem.
I made an Win32 Console Application.I just found out the command ShellExecute.I added the include:
[cpp]
#include <shellapi.h>
</cpp>
And then i used the command:
<cpp>
ShellExecute(NULL, "open", file, NULL, NULL, 0);
</cpp>
When i compiled it i got the following errors:
**
c:\program files\microsoft visual studio\vc98\include\shellapi.h(53) : error C2065: 'HDROP' : undeclared identifierc:\program files\microsoft visual studio\vc98\include\shellapi.h(53) : error C2501: 'DECLARE_HANDLE' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\shellapi.h(55) : error C2146: syntax error : missing ';' before identifier 'UINT'
c:\program files\microsoft visual studio\vc98\include\shellapi.h(55) : error C2501: 'DECLSPEC_IMPORT' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\shellapi.h(55) : fatal
error C1004: unexpected end of file found**
So if anyone could help me.
#ma*
-
Hi,
try to include <afxwin.h> instead of <shellapi.h>
should work !!!cu veganza
-
veganza schrieb:
Hi,
try to include <afxwin.h> instead of <shellapi.h>
should work !!!cu veganza
THANK U VVVEEEEERRRRYYYY MUCH
But now i have an linking error:LINK : fatal error LNK1104: cannot open file "nafxcwd.lib"
But when i checked Project --> Settings --> Link i couldn't find that library.So...If anyone could help me again that would b awsome.(And Veganza i set u by special thanks
).
#ma*
-
don't know where your problem is... I've just tested a Console-Application... and worked fine... no linking problems at all !!!
But I found something on the WWW:
Linking on Windows: Why does it complain about "nafxcwd.lib"?
The file "nafxcwd.lib" is a Visual C++ runtime library. If you cannot find this file, or any other with the letters "afx" in them, you have two possible solutions: (1) Change Electric from static linking to dynamic or (2) upgrade your Visual C++ to the latest service packs. To change to dynamic linking, use the "Settings" command of the "Project" menu. Under the "General" tab in the "Microsoft Foundation Classes" popup, select "Use MFC in a Shared DLL". Under the "Link" tab in the "Object/Library modules" section, remove "nafxcwd.lib".hope this help you out... Im running on Windows XP / VC 6 / SP 5
cu veganza
-
I uploaded my source code and now u can download it from:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=7175&lngWId=3
-
hi Hylke,
thx for the credits

glad to see that everything works fine for you now... you are welcome.
cu veganza