Jump to content

Problema Visual C++


Sebby
 Share

Recommended Posts

Salutare! Am facut un program in visual c++ 2008, am pus codurile, tot. L-am testat si nu au aparut erori. Am dat build->build solution si mi-a creat un executabil. Mie imi functioneaza, dar cand i l-am dat cuiva mi-a spus ca nu ii merge si ii apare eroarea asta:

 

this application has failed to the start because the application configuration is incorrect

 

Acum am vazut ca acolo in build am si o optiune Compile, dar nu imi da voie sa o selectez.

 

Cum rezolv aceasta problema?

Link to comment
Share on other sites

Optiunea "compile" e pentru a verifica programul de erori...nu are treaba.

 

Probabil cand tu ai dat build, pe langa executabil ti-a creat si un fisier config pe care il deschidea executabilul si citea din el, si in felul asta daca dai cuiva doar executabilul, fara fisierul config nu ii va merge.

Link to comment
Share on other sites

evident ca tre sa-l compilezi ca sa ti-l execute.. probabil e o greseala in cod, mai verifica-l, poate ti-a scapat o virgula ceva :)

Edited by XenonKB
Link to comment
Share on other sites

Nu imi apare nicio eroare in cod. Si dupa cum am spus mie imi functioneaza programul, deci nu asta e problema. Si l-am compilat, i-am dat build si nu a aparut nicio problema. Nu prea inteleg postul tau... am mai spus o data ceea ce am spus acum.

Link to comment
Share on other sites

Uitati codul de la un calculator facut dupa un tutorial de pe forum.

 

#pragma once


namespace Calculator {

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::TextBox^  textBox1;
protected: 
private: System::Windows::Forms::TextBox^  textBox2;
private: System::Windows::Forms::Label^  label1;
private: System::Windows::Forms::Label^  label2;
private: System::Windows::Forms::Button^  button1;
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)
	{
		this->textBox1 = (gcnew System::Windows::Forms::TextBox());
		this->textBox2 = (gcnew System::Windows::Forms::TextBox());
		this->label1 = (gcnew System::Windows::Forms::Label());
		this->label2 = (gcnew System::Windows::Forms::Label());
		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();
		// 
		// textBox1
		// 
		this->textBox1->Location = System::Drawing::Point(12, 12);
		this->textBox1->Name = L"textBox1";
		this->textBox1->Size = System::Drawing::Size(268, 20);
		this->textBox1->TabIndex = 0;
		// 
		// textBox2
		// 
		this->textBox2->Location = System::Drawing::Point(12, 61);
		this->textBox2->Name = L"textBox2";
		this->textBox2->Size = System::Drawing::Size(268, 20);
		this->textBox2->TabIndex = 1;
		// 
		// label1
		// 
		this->label1->Location = System::Drawing::Point(98, 35);
		this->label1->Name = L"label1";
		this->label1->Size = System::Drawing::Size(100, 23);
		this->label1->TabIndex = 2;
		this->label1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
		this->label1->Click += gcnew System::EventHandler(this, &Form1::label1_Click);
		// 
		// label2
		// 
		this->label2->Location = System::Drawing::Point(98, 84);
		this->label2->Name = L"label2";
		this->label2->Size = System::Drawing::Size(100, 23);
		this->label2->TabIndex = 3;
		this->label2->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
		// 
		// button1
		// 
		this->button1->Location = System::Drawing::Point(20, 122);
		this->button1->Name = L"button1";
		this->button1->Size = System::Drawing::Size(80, 42);
		this->button1->TabIndex = 4;
		this->button1->Text = L"+";
		this->button1->UseVisualStyleBackColor = true;
		this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
		// 
		// button2
		// 
		this->button2->Location = System::Drawing::Point(106, 122);
		this->button2->Name = L"button2";
		this->button2->Size = System::Drawing::Size(80, 42);
		this->button2->TabIndex = 5;
		this->button2->Text = L"-";
		this->button2->UseVisualStyleBackColor = true;
		this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
		// 
		// button3
		// 
		this->button3->Location = System::Drawing::Point(192, 122);
		this->button3->Name = L"button3";
		this->button3->Size = System::Drawing::Size(80, 42);
		this->button3->TabIndex = 6;
		this->button3->Text = L"Clear";
		this->button3->UseVisualStyleBackColor = true;
		this->button3->Click += gcnew System::EventHandler(this, &Form1::button3_Click_1);
		// 
		// button4
		// 
		this->button4->Location = System::Drawing::Point(20, 170);
		this->button4->Name = L"button4";
		this->button4->Size = System::Drawing::Size(80, 42);
		this->button4->TabIndex = 7;
		this->button4->Text = L"x";
		this->button4->UseVisualStyleBackColor = true;
		this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click);
		// 
		// button5
		// 
		this->button5->Location = System::Drawing::Point(106, 170);
		this->button5->Name = L"button5";
		this->button5->Size = System::Drawing::Size(80, 42);
		this->button5->TabIndex = 8;
		this->button5->Text = L"/";
		this->button5->UseVisualStyleBackColor = true;
		this->button5->Click += gcnew System::EventHandler(this, &Form1::button5_Click);
		// 
		// button6
		// 
		this->button6->Location = System::Drawing::Point(192, 170);
		this->button6->Name = L"button6";
		this->button6->Size = System::Drawing::Size(80, 42);
		this->button6->TabIndex = 9;
		this->button6->Text = L"=";
		this->button6->UseVisualStyleBackColor = true;
		this->button6->Click += gcnew System::EventHandler(this, &Form1::button6_Click);
		// 
		// Form1
		// 
		this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
		this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
		this->ClientSize = System::Drawing::Size(292, 224);
		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->Controls->Add(this->label2);
		this->Controls->Add(this->label1);
		this->Controls->Add(this->textBox2);
		this->Controls->Add(this->textBox1);
		this->Name = L"Form1";
		this->ShowIcon = false;
		this->Text = L"Calculator";
		this->ResumeLayout(false);
		this->PerformLayout();

	}
#pragma endregion
	char c; double x,y,d;
private: System::Void label1_Click(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void button3_Click(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
		 this->label1->Text = "+"; c='+';
	 }
private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
		 this->label1->Text = "-"; c='-';
	 }
private: System::Void button4_Click(System::Object^  sender, System::EventArgs^  e) {
		 this->label1->Text = "x"; c='x';
	 }
private: System::Void button5_Click(System::Object^  sender, System::EventArgs^  e) {
		 this->label1->Text = "/"; c='/';
	 }
private: System::Void button6_Click(System::Object^  sender, System::EventArgs^  e) {
		 x = System::Convert::ToInt32 (this->textBox1->Text);
		 y = System::Convert::ToInt32 (this->textBox2->Text);
		 switch(c)
		 {
		 case '+': d = x + y; break;
		 case '-': d = x - y; break;
		 case 'x': d = x * y; break;
		 case '/': d = x / y; break;
		 }
		 this->label2->Text = System::Convert::ToString(d);
	 }
private: System::Void button3_Click_1(System::Object^  sender, System::EventArgs^  e) {
		 this->textBox1->Text = ""; this->textBox2->Text = "";
		 this->label1->Text = ""; this->label2->Text = "";
	 }
};
}

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.