[Visual C++ 2010] Błąd z ShellExecute

0

Witam mam problem z odpaleniem aplikacji w visual c++ 2010 wyskakuje mi taki error
error C2660: 'ShellExecuteA' : function does not take 5 arguments

Oto część kodu aplikacji :

ShellExecute("open", "plik.exe", NULL, NULL, SW_SHOWNORMAL); 

proszę o pomoc

0

Przecież masz napisane co to za błąd: funkcja nie pobiera 5 argumentów. Potrzebuje 6-ciu: http://msdn.microsoft.com/en-us/library/bb762153%28VS.85%29.aspx

0

zrobiłem według przykładu na stronie

ShellExecute(Handle, "open", "plik.exe", NULL, NULL, SW_SHOWNORMAL); 

i wyskakuje coś takiego :

error C2664: 'ShellExecuteA' : cannot convert parameter 1 from 'System::IntPtr' to 'HWND'
          No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 
0

Pierwszym parametrem ma być coś typu HWND a nie System::IntPtr. Ehhh wrzuć tam NULL, może będzie działać tak jak chcesz.

0

dodałem NULL i mam taki error

 error LNK2028: unresolved token (0A00001F) "extern "C" struct HINSTANCE__ * __stdcall ShellExecuteA(struct HWND__ *,char const *,char const *,char const *,char const *,int)" (?ShellExecuteA@@$$J224YGPAUHINSTANCE__@@PAUHWND__@@PBD111H@Z) referenced in function "private: void __clrcall Multisamp::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@Multisamp@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
error LNK2019: unresolved external symbol "extern "C" struct HINSTANCE__ * __stdcall ShellExecuteA(struct HWND__ *,char const *,char const *,char const *,char const *,int)" (?ShellExecuteA@@$$J224YGPAUHINSTANCE__@@PAUHWND__@@PBD111H@Z) referenced in function "private: void __clrcall Multisamp::Form1::button1_Click(class System::Object ^,class System::EventArgs ^)" (?button1_Click@Form1@Multisamp@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
fatal error LNK1120: 2 unresolved externals
0

zamiast NULL zrób prawidłowo

ShellExecute((HWND)Handle.ToPointer(), L"open", L"plik.exe", NULL, NULL, SW_SHOWNORMAL); 

mam taki error

Project|Properties|Configuration: All Configurations|Linker|Input, Additional dependencies|...Shell32.lib $(NOINHERIT)
(to na podstawie VS 2008)

1 użytkowników online, w tym zalogowanych: 0, gości: 1