lordankou | Bonjour,
J'ai ma class userInterface cree a partir visual c++ 2008 dont le code est le suivant :
Code :
- #pragma once
- using namespace System;
- using namespace System::ComponentModel;
- using namespace System::Collections;
- using namespace System::Windows::Forms;
- using namespace System::Data;
- using namespace System::Drawing;
- namespace project3D {
- /// <summary>
- /// Summary for userInterface
- ///
- /// 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 userInterface : public System::Windows::Forms::Form
- {
- public:
- userInterface(void)
- {
- InitializeComponent();
- //
- //TODO: Add the constructor code here
- //
- }
- protected:
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- ~userInterface()
- {
- if (components)
- {
- delete components;
- }
- }
- private: System::Windows::Forms::ComboBox^ colorComboList;
- private: System::Windows::Forms::ComboBox^ cartogramComboList;
- private: System::Windows::Forms::ComboBox^ zComboList;
- protected:
- private: System::Windows::Forms::Label^ colorsLabel;
- private: System::Windows::Forms::Label^ cartogramLabel;
- private: System::Windows::Forms::Label^ zLabel;
- private: System::Windows::Forms::Button^ displayButton;
- private: System::Windows::Forms::CheckBox^ interpolateZCheckBox;
- private: System::Windows::Forms::Label^ setupAndDisplayLabel;
- protected:
- 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->colorComboList = (gcnew System::Windows::Forms::ComboBox());
- this->cartogramComboList = (gcnew System::Windows::Forms::ComboBox());
- this->zComboList = (gcnew System::Windows::Forms::ComboBox());
- this->colorsLabel = (gcnew System::Windows::Forms::Label());
- this->cartogramLabel = (gcnew System::Windows::Forms::Label());
- this->zLabel = (gcnew System::Windows::Forms::Label());
- this->displayButton = (gcnew System::Windows::Forms::Button());
- this->interpolateZCheckBox = (gcnew System::Windows::Forms::CheckBox());
- this->setupAndDisplayLabel = (gcnew System::Windows::Forms::Label());
- this->SuspendLayout();
- //
- // colorComboList
- //
- this->colorComboList->FlatStyle = System::Windows::Forms::FlatStyle::System;
- this->colorComboList->FormattingEnabled = true;
- this->colorComboList->Location = System::Drawing::Point(12, 95);
- this->colorComboList->Name = L"colorComboList";
- this->colorComboList->Size = System::Drawing::Size(266, 21);
- this->colorComboList->Sorted = true;
- this->colorComboList->TabIndex = 0;
- //
- // cartogramComboList
- //
- this->cartogramComboList->FormattingEnabled = true;
- this->cartogramComboList->Location = System::Drawing::Point(11, 170);
- this->cartogramComboList->Name = L"cartogramComboList";
- this->cartogramComboList->Size = System::Drawing::Size(267, 21);
- this->cartogramComboList->Sorted = true;
- this->cartogramComboList->TabIndex = 1;
- this->cartogramComboList->SelectedIndexChanged += gcnew System::EventHandler(this, &userInterface::comboBox2_SelectedIndexChanged);
- //
- // zComboList
- //
- this->zComboList->FormattingEnabled = true;
- this->zComboList->Location = System::Drawing::Point(12, 239);
- this->zComboList->Name = L"zComboList";
- this->zComboList->Size = System::Drawing::Size(267, 21);
- this->zComboList->Sorted = true;
- this->zComboList->TabIndex = 2;
- //
- // colorsLabel
- //
- this->colorsLabel->AutoSize = true;
- this->colorsLabel->Location = System::Drawing::Point(11, 70);
- this->colorsLabel->Name = L"colorsLabel";
- this->colorsLabel->Size = System::Drawing::Size(42, 13);
- this->colorsLabel->TabIndex = 3;
- this->colorsLabel->Text = L"Colors :";
- //
- // cartogramLabel
- //
- this->cartogramLabel->AutoSize = true;
- this->cartogramLabel->Location = System::Drawing::Point(8, 140);
- this->cartogramLabel->Name = L"cartogramLabel";
- this->cartogramLabel->Size = System::Drawing::Size(61, 13);
- this->cartogramLabel->TabIndex = 4;
- this->cartogramLabel->Text = L"Cartogram :";
- //
- // zLabel
- //
- this->zLabel->AutoSize = true;
- this->zLabel->Location = System::Drawing::Point(11, 214);
- this->zLabel->Name = L"zLabel";
- this->zLabel->Size = System::Drawing::Size(20, 13);
- this->zLabel->TabIndex = 5;
- this->zLabel->Text = L"Z :";
- //
- // displayButton
- //
- this->displayButton->Location = System::Drawing::Point(98, 309);
- this->displayButton->Name = L"displayButton";
- this->displayButton->Size = System::Drawing::Size(98, 44);
- this->displayButton->TabIndex = 6;
- this->displayButton->Text = L"Display";
- this->displayButton->UseVisualStyleBackColor = true;
- //
- // interpolateZCheckBox
- //
- this->interpolateZCheckBox->AutoSize = true;
- this->interpolateZCheckBox->Location = System::Drawing::Point(14, 266);
- this->interpolateZCheckBox->Name = L"interpolateZCheckBox";
- this->interpolateZCheckBox->Size = System::Drawing::Size(86, 17);
- this->interpolateZCheckBox->TabIndex = 7;
- this->interpolateZCheckBox->Text = L"Interpolate Z";
- this->interpolateZCheckBox->UseVisualStyleBackColor = true;
- //
- // setupAndDisplayLabel
- //
- this->setupAndDisplayLabel->AutoSize = true;
- this->setupAndDisplayLabel->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(0)));
- this->setupAndDisplayLabel->Location = System::Drawing::Point(65, 19);
- this->setupAndDisplayLabel->Name = L"setupAndDisplayLabel";
- this->setupAndDisplayLabel->Size = System::Drawing::Size(155, 20);
- this->setupAndDisplayLabel->TabIndex = 8;
- this->setupAndDisplayLabel->Text = L"Setup and Display";
- this->setupAndDisplayLabel->TextAlign = System::Drawing::ContentAlignment::TopCenter;
- //
- // userInterface
- //
- this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
- this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
- this->ClientSize = System::Drawing::Size(292, 365);
- this->Controls->Add(this->setupAndDisplayLabel);
- this->Controls->Add(this->interpolateZCheckBox);
- this->Controls->Add(this->displayButton);
- this->Controls->Add(this->zLabel);
- this->Controls->Add(this->cartogramLabel);
- this->Controls->Add(this->colorsLabel);
- this->Controls->Add(this->zComboList);
- this->Controls->Add(this->cartogramComboList);
- this->Controls->Add(this->colorComboList);
- this->Name = L"userInterface";
- this->Text = L"Setup and display";
- this->ResumeLayout(false);
- this->PerformLayout();
- }
- #pragma endregion
- private: System::Void comboBox2_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {
- }
- };
- }
|
un code vraiment classique est basique.
donc mon fichier cpp ou je veux utiliser cette UI j'ai lde code suivant :
Code :
- // incluse userInterface
- #include "userInterface/userInterface.h"
- int main(int argc, char *argv[]){
- userInterface UI;
- }
|
et l'erreur a la con suivant :
Code :
- error C2065: 'userInterface' : undeclared identifier
|
donc il ne reconnait pas la classe que je lui ai incluse. j'ai tente de trouver la reponse dans l'aide mais a croire que personne ne fait cette operation. donc j'aurai besoin d'aide |