Good day! I just can not figure out how to run an external program in Visual C ++. All that I found in the internet - does not work.
My code is:
#include <windows.h> using namespace System; using namespace System::Reflection; using namespace System::Windows::Forms; using namespace Microsoft::Win32; [STAThread] void Main(array<String^>^ args) { Application::EnableVisualStyles(); Application::SetCompatibleTextRenderingDefault(false); String^ InstallPath = nullptr; RegistryKey^ rk = nullptr; rk = Registry::LocalMachine->OpenSubKey("SOFTWARE\\MCFR\\KozaDisk"); if (rk != nullptr) { array<String^>^ name = rk->GetValueNames(); for (int i = 0; i < name->Length; i++) { String^ value = rk->GetValue(name[i])->ToString(); if (name[i] == "InstallPath") InstallPath = value; } } if (InstallPath != nullptr) { String^ AppPath = InstallPath + "Koza.exe"; // Π·Π°ΠΏΡΡΠΊΠ°Π΅ΠΌ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ AppPath } else { MessageBox::Show("Install"); } } The variable String ^ AppPath is the full path to the application to be launched. How can I do it?
Thank you in advance!!