Click here to Skip to main content
15,911,896 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
QuestionError with 'System.NullReferenceException' [modified] Pin
thesad17-Feb-07 4:12
thesad17-Feb-07 4:12 
QuestionRe: Error with 'System.NullReferenceException' Pin
Newbie0017-Feb-07 10:07
Newbie0017-Feb-07 10:07 
AnswerRe: Error with 'System.NullReferenceException' Pin
Christian Graus17-Feb-07 10:08
protectorChristian Graus17-Feb-07 10:08 
GeneralRe: Error with 'System.NullReferenceException' Pin
thesad17-Feb-07 12:16
thesad17-Feb-07 12:16 
AnswerRe: Error with 'System.NullReferenceException' Pin
prasad_som17-Feb-07 15:44
prasad_som17-Feb-07 15:44 
GeneralRe: Error with 'System.NullReferenceException' Pin
thesad17-Feb-07 21:44
thesad17-Feb-07 21:44 
AnswerRe: Error with 'System.NullReferenceException' Pin
prasad_som18-Feb-07 1:22
prasad_som18-Feb-07 1:22 
GeneralRe: Error with 'System.NullReferenceException' Pin
thesad18-Feb-07 2:05
thesad18-Feb-07 2:05 
Here is all code :
<br />
#pragma once<br />
namespace Littletanks {<br />
ref struct tank {<br />
  int step_x, step_y;  <br />
  System::Windows::Forms::PictureBox^ pct;<br />
};<br />
using namespace System;<br />
using namespace System::ComponentModel;<br />
using namespace System::Collections;<br />
using namespace System::Windows::Forms;<br />
using namespace System::Data;<br />
using namespace System::Drawing;<br />
public ref class wnd_main : public System::Windows::Forms::Form {<br />
	public: wnd_main(void) {<br />
			InitializeComponent();<br />
		    }<br />
	protected: ~wnd_main() {<br />
			if (components) delete components;<br />
		    }<br />
	private: System::ComponentModel::IContainer^  components;<br />
    private: int max_x, max_y, min_x, min_y;<br />
    private: tank usr, b_usr;<br />
    private: static array<tank^>^ em; <br />
    private: static array<tank^>^ b_em; <br />
	<br />
#pragma region Windows Form Designer generated code<br />
		void InitializeComponent(void)<br />
		{<br />
			this->components = (gcnew System::ComponentModel::Container());<br />
			this->usr.pct = (gcnew System::Windows::Forms::PictureBox());<br />
			this->b_usr.pct = (gcnew System::Windows::Forms::PictureBox());<br />
			this->SuspendLayout();<br />
			// <br />
			// pct_usr<br />
			// <br />
			this->usr.pct->Location = System::Drawing::Point(235, 391);<br />
			this->usr.pct->Size = System::Drawing::Size(50, 50);<br />
			this->usr.pct->TabStop = false;<br />
			// <br />
			// pct_em<br />
			//<br />
			array<tank^>^ em = gcnew array<tank^>(10);<br />
			array<tank^>^ b_em = gcnew array<tank^>(10);<br />
			for(int i=0; i <10; i++){<br />
			  this->em[i]->pct = gcnew System::Windows::Forms::PictureBox();<br />
			  this->em[i]->pct->Location = System::Drawing::Point(250, 250);<br />
			  this->em[i]->pct->Visible = true;<br />
			  this->em[i]->pct->Size = System::Drawing::Size(50, 50);<br />
              this->b_em[i]->pct = gcnew System::Windows::Forms::PictureBox();<br />
			  this->b_em[i]->pct->Load("b_em[i]->jpg");<br />
		      this->b_em[i]->pct->Location = System::Drawing::Point(13, 64);<br />
			  this->b_em[i]->pct->Size = System::Drawing::Size(5, 5);<br />
			  this->b_em[i]->pct->Visible = false;<br />
			  this->Controls->Add(this->b_em[i]->pct);<br />
			  this->Controls->Add(this->em[i]->pct);<br />
			} <br />
			this->b_usr.pct->Load("b_usr.jpg");<br />
			this->b_usr.pct->Location = System::Drawing::Point(97, 142);<br />
			this->b_usr.pct->Size = System::Drawing::Size(5, 5);<br />
			this->b_usr.pct->Visible = false;<br />
			// wnd_main<br />
			// <br />
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);<br />
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;<br />
			this->BackColor = System::Drawing::SystemColors::Window;<br />
			this->ClientSize = System::Drawing::Size(500, 500);<br />
			this->MaximizeBox = false;<br />
			this->MinimizeBox = false;<br />
			this->Controls->Add(this->b_usr.pct);<br />
			this->Controls->Add(this->usr.pct);<br />
			this->KeyDown += gcnew System::Windows::Forms::KeyEventHandler(this, &wnd_main::wnd_main_KeyDown);<br />
			this->Name = L"wnd_main";<br />
			this->Text = L"Little tanks ";<br />
			this->statusStrip1->ResumeLayout(false);<br />
			this->statusStrip1->PerformLayout();<br />
			this->menuStrip1->ResumeLayout(false);<br />
			this->menuStrip1->PerformLayout();<br />
			this->ResumeLayout(false);<br />
			this->PerformLayout();<br />
		}<br />
#pragma endregion<br />

AnswerRe: Error with 'System.NullReferenceException' Pin
prasad_som18-Feb-07 4:20
prasad_som18-Feb-07 4:20 
GeneralRe: Error with 'System.NullReferenceException' [modified] Pin
thesad18-Feb-07 4:48
thesad18-Feb-07 4:48 
GeneralRe: Error with 'System.NullReferenceException' Pin
Christian Graus18-Feb-07 9:11
protectorChristian Graus18-Feb-07 9:11 
GeneralRe: Error with 'System.NullReferenceException' Pin
prasad_som19-Feb-07 3:11
prasad_som19-Feb-07 3:11 
QuestionXp style problem in Visual Studio 2005 Pin
Vinod Moorkkan16-Feb-07 17:54
Vinod Moorkkan16-Feb-07 17:54 
AnswerRe: Xp style problem in Visual Studio 2005 Pin
Bartosz Bien20-Feb-07 20:51
Bartosz Bien20-Feb-07 20:51 
QuestionSerial Port - Remote Control Pin
frozenice16-Feb-07 11:24
frozenice16-Feb-07 11:24 
Questionproblem with Random Pin
thesad15-Feb-07 7:46
thesad15-Feb-07 7:46 
AnswerRe: problem with Random Pin
Christian Graus15-Feb-07 8:14
protectorChristian Graus15-Feb-07 8:14 
GeneralRe: problem with Random Pin
thesad15-Feb-07 8:28
thesad15-Feb-07 8:28 
QuestionEmail Messages Pin
Programm3r15-Feb-07 2:23
Programm3r15-Feb-07 2:23 
QuestionRe: Email Messages Pin
prasad_som15-Feb-07 2:39
prasad_som15-Feb-07 2:39 
QuestionRe: Email Messages Pin
Programm3r15-Feb-07 21:03
Programm3r15-Feb-07 21:03 
QuestionRe: Email Messages Pin
prasad_som15-Feb-07 21:40
prasad_som15-Feb-07 21:40 
AnswerRe: Email Messages Pin
ThatsAlok21-Feb-07 6:20
ThatsAlok21-Feb-07 6:20 
Questioncapture s-video from my pinnacle pci card to borland c++ Pin
bozzim14-Feb-07 22:40
bozzim14-Feb-07 22:40 
AnswerRe: capture s-video from my pinnacle pci card to borland c++ Pin
Christian Graus15-Feb-07 0:15
protectorChristian Graus15-Feb-07 0:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.