System.ArgumentExeption
-
Hi,
wenn ich nachstehenden Code ausführe erhalte ich folgenden Fehler:
"Eine nicht behandelte Ausnahme des Types 'System.ArgumentExeption' ist in system.windows.forms.dll aufgetreten.
Zusätzliche Informationen: Ungültige Parameter verwendet."
#include "stdafx.h" #using <mscorlib.dll> #using <System.dll> #using <System.Drawing.dll> #using <System.Windows.Forms.dll> using namespace System; using namespace System::Drawing; using namespace System::Windows::Forms; using namespace System::Collections;; __gc class StartMenue : public Form { public: StartMenue() { Text = "The Fighters of Sarazon 0.9"; BackColor = System::Drawing::Color::Black; Paint += new PaintEventHandler(this, &StartMenue::Form_Paint); Setup_Buttons(); Setup_Label(); } private: Button* btn1; Button* btn2; Button* btn3; Button* btn4; Label* lbl1; void Setup_Buttons() { ...HIER WERDEN DIE GANZEN bUTTONS ERSTELLET UND MIT CONTROLS VERKNÜPFT SOWIE MIT DEM EREIGNISHANDLER... } void Setup_Label() { lbl1 = new Label(); lbl1->AutoSize = true; lbl1->Text = "created by PA (30.01.06)"; lbl1->Location = Point(840,760); lbl1->Size = System::Drawing::Size (lbl1->PreferredHeight, lbl1->PreferredWidth); lbl1->Font = new System::Drawing::Font("Comic Sans MS", 13, FontStyle::Italic); lbl1->ForeColor = Color::White; Controls->Add(lbl1); } void Clicked(Object* pSender, EventArgs* pArgs) { if (pSender == btn1) { Close(); } if (pSender == btn2) { MessageBox::Show("Diese Option ist in der Demoversion nicht verfügbar"); } if (pSender == btn3) { MessageBox::Show("Diese Option ist in der Demoversion nicht verfügbar"); } if (pSender == btn4) { Application::Exit(); } } void Form_Paint(Object* pSender, PaintEventArgs* pe) { Graphics* gr = pe->Graphics; Bitmap* bmp = new Bitmap("Logo 2.0.bmp"); gr->DrawImage(bmp, 75,55); } }; __gc class Site_1 : public Form { public: Site_1() { Text = "The Fighters of Sarazon 0.9"; BackColor = System::Drawing::Color::Black; Size = System::Drawing::Size(1170,800); Paint += new PaintEventHandler(this, &Site_1::Form_Paint); Setup_Buttons(); Setup_Label(); Setup_Texts(); } private: TextBox* text1; TextBox* text2; void Setup_Buttons(){}; void Setup_Label(){}; void Form_Paint(Object* pSender, PaintEventArgs* pe) { Graphics* gr = pe->Graphics; Graphics* gs = pe->Graphics; Graphics* gt = pe->Graphics; Graphics* gu = pe->Graphics; Bitmap* bmp = new Bitmap("Logo 2.3.bmp"); gr->DrawImage(bmp, 35,35); Bitmap* bmp2 = new Bitmap ("Star 1.1.bmp"); gs->DrawImage(bmp2,7,565); Bitmap* bmp3 = new Bitmap("Star 1.2.bmp"); gt->DrawImage(bmp3, 900, 650); Bitmap* bmp4 = new Bitmap("Star 1.0.bmp"); gu->DrawImage(bmp4, 720, 10); } void Setup_Texts() { text2 = new TextBox(); text2->Location = Point(140,283); text2->Size = System::Drawing::Size(940,300); text2->ForeColor = System::Drawing::Color::White; text2->Font = new System::Drawing::Font("Comic Sans MS",14, FontStyle::Regular); text2->Enabled = false; text2->Multiline = true; text2->Text = ".....TEXT.....\r\n\r\n"; text2->BackColor = Color::Black; Controls->Add(text2); } }; int _stdcall WinMain (void) { Application::Run(new StartMenue()); Application::Run(new Site_1()); return 0; }
Als Fehlerort wird immer die Zeile: Appliaction::Run(new Site_1());
angegeben.Weiss jemand woran es liegt??
Bin für jeden kleinen Tipp dankbar.
-
Dieser Thread wurde von Moderator/in HumeSikkins aus dem Forum C++ in das Forum MFC (Visual C++) verschoben.
Im Zweifelsfall bitte auch folgende Hinweise beachten:
C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?Dieses Posting wurde automatisch erzeugt.
-
Vermutlich kann man in einem Thread nicht zweimal nacheinander ein "Application.Run" aufrufen...