свёл ошибки до 1-й вот код моей минюшки
Код |
#include "stdafx.h" #include "windows.h" #include <iostream> using namespace std; #include "shellapi.h" #include "brous.h" #include "Calc.h" #pragma once
namespace KURS {
using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing;
/// <summary> /// Summary for Form1 /// /// WARNING: If you change the name of this class, you will need to change the /// 'Resource File Name' property for the managed resource compiler tool /// associated with all .resx files this class depends on. Otherwise, /// the designers will not be able to interact properly with localized /// resources associated with this form. /// </summary> public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); // //TODO: Add the constructor code here // }
protected: /// <summary> /// Clean up any resources being used. /// </summary> ~Form1() { if (components) { delete components; } } private: System::Windows::Forms::Button^ button1; protected: private: System::Windows::Forms::Button^ button2; private: System::Windows::Forms::Button^ button3; private: System::Windows::Forms::Button^ button4; private: System::Windows::Forms::Button^ button5; private: System::Windows::Forms::Button^ button6;
private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> void InitializeComponent(void) { System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid)); this->button1 = (gcnew System::Windows::Forms::Button()); this->button2 = (gcnew System::Windows::Forms::Button()); this->button3 = (gcnew System::Windows::Forms::Button()); this->button4 = (gcnew System::Windows::Forms::Button()); this->button5 = (gcnew System::Windows::Forms::Button()); this->button6 = (gcnew System::Windows::Forms::Button()); this->SuspendLayout(); // // button1 // this->button1->Location = System::Drawing::Point(12, 12); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(75, 23); this->button1->TabIndex = 0; this->button1->Text = L"button1"; this->button1->UseVisualStyleBackColor = true; // // button2 // this->button2->Location = System::Drawing::Point(12, 86); this->button2->Name = L"button2"; this->button2->Size = System::Drawing::Size(75, 23); this->button2->TabIndex = 1; this->button2->Text = L"Browser"; this->button2->UseVisualStyleBackColor = true; this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click); // // button3 // this->button3->Location = System::Drawing::Point(174, 12); this->button3->Name = L"button3"; this->button3->Size = System::Drawing::Size(75, 23); this->button3->TabIndex = 2; this->button3->Text = L"button3"; this->button3->UseVisualStyleBackColor = true; // // button4 // this->button4->Location = System::Drawing::Point(174, 86); this->button4->Name = L"button4"; this->button4->Size = System::Drawing::Size(75, 23); this->button4->TabIndex = 3; this->button4->Text = L"Calculater"; this->button4->UseVisualStyleBackColor = true; this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click); // // button5 // this->button5->Location = System::Drawing::Point(93, 64); this->button5->Name = L"button5"; this->button5->Size = System::Drawing::Size(75, 23); this->button5->TabIndex = 4; this->button5->Text = L"button5"; this->button5->UseVisualStyleBackColor = true; // // button6 // this->button6->Location = System::Drawing::Point(93, 35); this->button6->Name = L"button6"; this->button6->Size = System::Drawing::Size(75, 23); this->button6->TabIndex = 5; this->button6->Text = L"button6"; this->button6->UseVisualStyleBackColor = true; // // Form1 // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(260, 130); this->Controls->Add(this->button6); this->Controls->Add(this->button5); this->Controls->Add(this->button4); this->Controls->Add(this->button3); this->Controls->Add(this->button2); this->Controls->Add(this->button1); this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon"))); this->MaximizeBox = false; this->Name = L"Form1"; this->Text = L"BDAv0.0.1"; this->ResumeLayout(false);
} #pragma endregion private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { brous ^br=gcnew brous(); br->Show(); } private: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e) { ShellExecute(NULL, "open", "c:\\Calc\\Project1.exe", NULL, NULL, SW_SHOWNORMAL);
} }; }
|
а ошибка
Код | ------ Build started: Project: KURS, Configuration: Debug Win32 ------ Compiling... KURS.cpp c:\kursovaya\kurs\kurs\Form1.h(162) : error C2664: 'ShellExecuteW' : cannot convert parameter 2 from 'const char [5]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast Build log was saved at "file://c:\KURSOVAYA\KURS\KURS\Debug\BuildLog.htm" KURS - 1 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
|